Skip to content

Commit

Permalink
Add GA Actions workflows for build and release pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
eerkkk committed Sep 29, 2023
1 parent 0793c01 commit 51f0bb8
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: build
on:
push:
branches:
- '*'
pull_request: {}

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- run: "go vet ./..."
- name: Lint
uses: dominikh/[email protected]
with:
version: "2022.1.3"
snapshot-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Set GOLANG_VERSION
run: |
echo "GOLANG_VERSION=$(go version | awk '{ print $3 }')" >> $GITHUB_ENV
- name: Snapshot Build
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --snapshot --skip=publish --clean
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: release
on:
push:
tags:
- 'v*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Set GOLANG_VERSION
run: |
echo "GOLANG_VERSION=$(go version | awk '{ print $3 }')" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Tagged Release
uses: goreleaser/goreleaser-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
distribution: goreleaser
version: latest
args: release --clean

0 comments on commit 51f0bb8

Please sign in to comment.