From f9a02fe298cbf9687a5971b14462681def38fbd2 Mon Sep 17 00:00:00 2001 From: Aidan Delaney Date: Thu, 9 Mar 2023 06:24:00 +0000 Subject: [PATCH] fixup! Run goreleaser on merge to main Signed-off-by: Aidan Delaney --- .github/workflows/go.yml | 12 ----------- .github/workflows/goreleaser.yml | 37 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/goreleaser.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 21bd8659..92068082 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -6,9 +6,6 @@ on: pull_request: branches: [ main ] -permissions: - contents: write - jobs: build: @@ -26,12 +23,3 @@ jobs: - name: Test run: go test -v ./... - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 - with: - distribution: goreleaser - version: latest - args: release --clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 00000000..f7c47f09 --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -0,0 +1,37 @@ +name: goreleaser + +on: + pull_request: + branches: + - main + types: [closed] + paths-ignore: + - '**.md' + - 'resources/**' + - 'CODEOWNERS' + - 'LICENSE' + +permissions: + contents: write + +jobs: + goreleaser: + if: ${{ github.event.pull_request.merged }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.20 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}