diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index e5181587..53ab6dff 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,7 +1,6 @@ name: Publish on: - pull_request: workflow_dispatch: push: tags: @@ -15,7 +14,7 @@ env: jobs: config: name: Check GoReleaser config - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && contains(github.ref, 'refs/tags/')) runs-on: ubuntu-latest steps: - name: Checkout @@ -28,7 +27,7 @@ jobs: publish: name: "Publish provider" - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && contains(github.ref, 'refs/tags/')) needs: config runs-on: ubuntu-latest permissions: @@ -81,6 +80,7 @@ jobs: gpg --import private.key - name: Run GoReleaser + if: github.event_name == 'workflow_dispatch' id: goreleaser env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -89,6 +89,16 @@ jobs: with: args: release --skip publish --clean --snapshot + - name: Run GoReleaser + if: github.event_name != 'workflow_dispatch' + id: goreleaser + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} + uses: goreleaser/goreleaser-action@v6 + with: + args: release --skip publish --clean + - name: Prepare key file run: | echo $(echo ${{ secrets.KEY_FILE_B64 }} | base64 -d) >public_key.pem