diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 9e60e4f..b0e7a50 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -1,6 +1,15 @@ -name: Go +name: Go - Development Build -on: [push] +on: + pull_request: + push: + branches: + - main + +concurrency: + # Cancels pending runs when a PR gets updated. + group: ${{ github.head_ref || github.run_id }}-${{ github.actor }} + cancel-in-progress: true jobs: build: @@ -40,7 +49,6 @@ jobs: uses: actions/setup-go@v4.0.1 with: go-version: 1.20.7 - - name: Run golangci-lint uses: golangci/golangci-lint-action@v3.6.0 with: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..6c5135d --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,36 @@ +name: Go - Release Build + +on: + push: + tags: + - '*' + +concurrency: + # Cancels pending runs when a PR gets updated. + group: ${{ github.head_ref || github.run_id }}-${{ github.actor }} + cancel-in-progress: true + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3.5.3 + with: + fetch-depth: 0 + - run: git fetch --force --tags + - name: Setup Go + uses: actions/setup-go@v4.0.1 + with: + go-version: 1.20.7 + - name: Execute GoReleaser + uses: goreleaser/goreleaser-action@v4.4.0 + if: startsWith(github.ref, 'refs/tags/') + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 2d51995..70dc184 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # BigQuery Query Runner -[![Workflows](https://github.com/wintermi/bqrunner/workflows/Go/badge.svg)](https://github.com/wintermi/bqrunner/actions/workflows/go.yml) +[![Workflows](https://github.com/wintermi/bqrunner/workflows/Go/badge.svg)](https://github.com/wintermi/bqrunner/actions) [![Go Report](https://goreportcard.com/badge/github.com/wintermi/bqrunner)](https://goreportcard.com/report/github.com/wintermi/bqrunner) [![License](https://img.shields.io/github/license/wintermi/bqrunner.svg)](https://github.com/wintermi/bqrunner/blob/main/LICENSE) [![Release](https://img.shields.io/github/v/release/wintermi/bqrunner?include_prereleases)](https://github.com/wintermi/bqrunner/releases) diff --git a/main.go b/main.go index 31d3229..3cbaac4 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var logger zerolog.Logger -var applicationText = "%s 0.1.1%s" +var applicationText = "%s 0.1.2%s" var copyrightText = "Copyright 2022-2023, Matthew Winter\n" var indent = "..."