name: Go on: push: branches: [ main ] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v2 with: go-version: 1.17 - name: Test run: go test -v ./... - name: Lint source code run: | make tools lint rm -rf .bin/ rm -rf dist/ - name: Set up Git actions user uses: fregante/setup-git-user@v1 - name: Collect and save licenses run: | go install github.com/google/go-licenses@latest go-licenses save . --save_path="licenses" git add licenses git commit -m "Updated licenses" git push git clean && git reset --hard - name: Create release tag run: | git tag "v$(git show -s --format=%cd --date=format:%Y%m%d.%H%M%S)" git push --tags - name: Release binaries with GoReleaser uses: goreleaser/goreleaser-action@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: args: release --rm-dist