-
-
Notifications
You must be signed in to change notification settings - Fork 8
73 lines (69 loc) · 1.99 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
73
name: release
on:
push:
branches:
- "main"
permissions:
contents: read
jobs:
generate-changelog:
runs-on: ubuntu-latest
needs:
- goreleaser
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Generate a changelog
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --verbose
env:
OUTPUT: docs/CHANGELOG.md
- name: Commit files
id: commit
run: |
if git diff --quiet; then
echo "No changes to commit."
echo "hasdiff=false" >> "$GITHUB_OUTPUT"
else
echo "Changes detected."
echo "hasdiff=true" >> "$GITHUB_OUTPUT"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add docs/CHANGELOG.md
git commit -m "chore(docs): update changelog"
fi
- name: Push changes
if: ${{ steps.commit.outputs.hasdiff == 'true' }}
uses: ad-m/github-push-action@v0.8.0
with:
github_token: ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@v5
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
install-only: true
- name: Show GoReleaser version
run: goreleaser -v
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
with:
extra_plugins: |
@semantic-release/git
@semantic-release/exec