-
Notifications
You must be signed in to change notification settings - Fork 36
72 lines (60 loc) · 1.82 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
70
71
72
name: release
on:
push:
branches: [ main ]
paths: [ CHANGELOG.md ]
jobs:
release:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Setup NPM
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Add env vars
run: |
echo GORELEASER_CURRENT_TAG=$(go run main.go latest) >> $GITHUB_ENV
echo RELEASE_NOTES_PATH=.changes/$(go run main.go latest).md >> $GITHUB_ENV
- name: Run GoReleaser
uses: goreleaser/[email protected]
with:
version: latest
args: --clean --release-notes=${{ env.RELEASE_NOTES_PATH }} --skip=validate --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WINGET_PAT: ${{ secrets.WINGET_PAT }}
- name: Publish to NPM
run: |
node npm/prepare-release.mjs
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Setup Hugo
uses: peaceiris/[email protected]
with:
hugo-version: 'latest'
extended: true
- name: Build docs
run: |
go run main.go gen
awk 'NR > 1' CHANGELOG.md >> docs/content/guide/changelog/index.md
hugo --minify -s docs -b https://changie.dev/
- name: Deploy docs
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/public
cname: changie.dev