From d6374c23013396d22c6fdf689ebadb5a21c3c92f Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Sun, 25 Aug 2024 10:07:37 +1000 Subject: [PATCH] chore(ci): only release after CI on main passes --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ .github/workflows/release.yml | 25 ------------------------- 2 files changed, 21 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b87c8d..2739238 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,3 +35,24 @@ jobs: golangci-lint run ); done git diff + release: + if: github.ref == 'refs/heads/main' + needs: ["test", "lint"] + name: Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: cashapp/activate-hermit@v1 + - uses: charlesthomas/github-action-svu@v1.0.5+2.1.1 + id: svu + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: | + git tag ${{ steps.svu.outputs.next }} + goreleaser release --fail-fast + git push --tags + if: ${{ steps.svu.outputs.changed }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index fc07750..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,25 +0,0 @@ -on: - push: - branches: - - main -name: Release -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: cashapp/activate-hermit@v1 - - uses: charlesthomas/github-action-svu@v1.0.5+2.1.1 - id: svu - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: | - git tag ${{ steps.svu.outputs.next }} - goreleaser release --fail-fast - git push --tags - if: ${{ steps.svu.outputs.changed }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}