-
Notifications
You must be signed in to change notification settings - Fork 56
69 lines (58 loc) · 1.91 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Release
on:
workflow_dispatch:
inputs:
newVersionTag:
description: 'New version tag (e.g. v0.10.11)'
required: true
jobs:
release:
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ steps.app-token.outputs.token }}
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21.x
- name: Install and run auto-changelog CLI
run: |
npm i -g [email protected]
auto-changelog --config=.auto-changelog-config --latest-version=${{ github.event.inputs.newVersionTag }}
- name: Setup Git config
run: |
git config user.name "GitHub Actions"
git config user.email [email protected]
- name: Add and commit generated files
run: |
git add .
git commit -m "Update docs and CHANGELOG.md"
- name: Create a tag and push
run: |
git pull -r origin master
git tag -a ${{ github.event.inputs.newVersionTag }} -m ""
git push origin master --follow-tags
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: "1.25.1"
args: release --clean
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}