fix: updated publish pipeline #3
1 changed files with 13 additions and 3 deletions
16
.github/workflows/publish.yaml
vendored
16
.github/workflows/publish.yaml
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue