|
1 | | -# This GitHub action can publish assets for release when a tag is created. |
2 | | -# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0). |
3 | | -# |
4 | | -# This uses an action (hashicorp/ghaction-import-gpg) that assumes you set your |
5 | | -# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE` |
6 | | -# secret. If you would rather own your own GPG handling, please fork this action |
7 | | -# or use an alternative one for key handling. |
8 | | -# |
9 | | -# You will need to pass the `--batch` flag to `gpg` in your signing step |
10 | | -# in `goreleaser` to indicate this is being used in a non-interactive mode. |
11 | | -# |
12 | 1 | name: release |
13 | 2 | on: |
14 | | - push: |
15 | | - tags: |
16 | | - - "v*" |
17 | | -permissions: |
18 | | - contents: write |
| 3 | + workflow_dispatch: |
| 4 | + |
19 | 5 | jobs: |
20 | 6 | goreleaser: |
21 | 7 | runs-on: ubuntu-latest |
22 | 8 | steps: |
23 | 9 | - name: Checkout |
24 | 10 | uses: actions/checkout@v4 |
| 11 | + with: |
| 12 | + fetch-depth: 0 |
25 | 13 |
|
26 | | - - name: Unshallow |
27 | | - run: git fetch --prune --unshallow |
28 | | - |
29 | | - - uses: actions/setup-go@v5 |
| 14 | + - name: Set up Go |
| 15 | + uses: actions/setup-go@v5 |
30 | 16 | with: |
31 | | - go-version-file: "go.mod" |
32 | | - cache: true |
| 17 | + go-version-file: go.mod |
33 | 18 |
|
34 | 19 | - name: Import GPG key |
35 | | - uses: crazy-max/ghaction-import-gpg@v6 |
36 | 20 | id: import_gpg |
37 | | - with: |
38 | | - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} |
39 | | - passphrase: ${{ secrets.GPG_PASSPHRASE }} |
| 21 | + uses: paultyng/ghaction-import-gpg@v2.1.0 |
| 22 | + env: |
| 23 | + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} |
| 24 | + PASSPHRASE: ${{ secrets.PASSPHRASE }} |
40 | 25 |
|
41 | 26 | - name: Run GoReleaser |
42 | | - uses: goreleaser/goreleaser-action@v6.2.1 |
| 27 | + uses: goreleaser/goreleaser-action@v6 |
43 | 28 | with: |
44 | 29 | version: latest |
45 | | - args: release --rm-dist |
| 30 | + args: release --clean |
46 | 31 | env: |
47 | 32 | GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} |
48 | 33 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments