From 3c15fb442858be41625e7b65bf5dd608a17a8596 Mon Sep 17 00:00:00 2001 From: Benjamin Kane <6081085+bbkane@users.noreply.github.com> Date: Wed, 1 Mar 2023 20:01:18 -0800 Subject: [PATCH] Add release.yml --- .github/workflows/gorelease.yml | 32 --------------------------- .github/workflows/release.yml | 38 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 32 deletions(-) delete mode 100644 .github/workflows/gorelease.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/gorelease.yml b/.github/workflows/gorelease.yml deleted file mode 100644 index 0ca31a8..0000000 --- a/.github/workflows/gorelease.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Go build and release - -on: - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' - -permissions: - contents: write - -jobs: - goreleaser: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Go 1.x - uses: actions/setup-go@v3 - with: - go-version: '>=1.18.0' - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 - with: - version: latest - args: release --rm-dist - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - KEY_GITHUB_GORELEASER_TO_HOMEBREW_TAP: ${{ secrets.KEY_GITHUB_GORELEASER_TO_HOMEBREW_TAP }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6da0f45 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: Release + +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" +permissions: + contents: write + +jobs: + ci: + uses: ./.github/workflows/ci.yml + setup: + name: Release + runs-on: ubuntu-latest + needs: ci + steps: + # https://github.com/marketplace/actions/checkout` + - name: Checkout Repo + uses: actions/checkout@v3 + + # https://github.com/marketplace/actions/setup-go-environment + - name: Set up Go 1.x >= 1.18 + uses: actions/setup-go@v3 + with: + go-version-file: go.mod + # requires go.sum file (i.e., external libraries) + cache: true + + # https://github.com/marketplace/actions/goreleaser-action + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v3 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + KEY_GITHUB_GORELEASER_TO_HOMEBREW_TAP: ${{ secrets.KEY_GITHUB_GORELEASER_TO_HOMEBREW_TAP }}