From 72a45d406587733ea23b2ec951e3df4190de315f Mon Sep 17 00:00:00 2001 From: Maximilian Blatt Date: Thu, 8 Feb 2024 19:14:19 +0100 Subject: [PATCH] chore(ci): Fix release pipeline Signed-off-by: Maximilian Blatt --- .github/workflows/ci.yaml | 28 ++++++++++++++++++++++ .github/workflows/release.yaml | 43 ---------------------------------- 2 files changed, 28 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0136e2b..a6a0bd5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,6 +36,34 @@ jobs: distribution: goreleaser version: ${{ env.GORELEASER_VERSION }} args: build --clean --snapshot + - name: Publish artifacts to Github + uses: actions/upload-artifact@v4 + if: ${{ ! startsWith(github.ref, 'refs/tags/') }} + with: + name: dist + path: dist + release: + needs: + - lint + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/') }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: ${{ env.GORELEASER_VERSION }} + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Publish artifacts to Github uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index b02ea9f..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: release - -on: - push: - tags: - - "*" - -permissions: - contents: write - -env: - GO_VERSION: '1.21.6' - GOLANGCI_VERSION: 'v1.55.2' - GORELEASER_VERSION: 'v1.23.0' - -jobs: - goreleaser: - needs: - - build - - lint - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: ${{ env.GO_VERSION }} - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v5 - with: - distribution: goreleaser - version: ${{ env.GORELEASER_VERSION }} - args: release --clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Publish artifacts to Github - uses: actions/upload-artifact@v4 - with: - name: dist - path: dist