-
Notifications
You must be signed in to change notification settings - Fork 4
121 lines (116 loc) Β· 3.65 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Release
on:
push:
tags:
- 'v*'
env:
TZ: Asia/Shanghai
GO_VERSION: '1.23'
permissions: write-all
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
- name: install task
run: |
echo "install task"
go install github.com/go-task/task/v3/cmd/task@latest
- name: install upx
uses: crazy-max/ghaction-upx@v3
with:
install-only: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Publish .deb & .rpm to Gemfury
env:
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
run: |
for filename in dist/*.deb; do
if [[ "$filename" == *"arm"* ]]; then
echo "Skipping $filename"
continue
fi
echo "Pushing $filename to apt repository"
curl -F package=@$filename https://${FURY_TOKEN}@push.fury.io/qucheng/
curl -F package=@$filename https://${FURY_TOKEN}@push.fury.io/qucheng/
done
for filename in dist/*.rpm; do
if [[ "$filename" == *"arm"* ]]; then
echo "Skipping $filename"
continue
fi
echo "Pushing $filename to rpm repository"
curl -F package=@$filename https://${FURY_TOKEN}@push.fury.io/qucheng/
curl -F package=@$filename https://${FURY_TOKEN}@push.fury.io/qucheng/
done
- name: "Upload checksums.txt"
uses: actions/upload-artifact@v4
with: { name: checksums.txt, path: dist/checksums.txt }
Changelog:
name: "Changelog"
needs: release
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
- name: install task
run: |
echo "install task"
go install github.com/go-task/task/v3/cmd/task@latest
- name: "download checksums.txt"
uses: actions/download-artifact@v4
with: { name: checksums.txt, path: dist }
- run: ./hack/scripts/gentap.sh
- name: Build docs
run: |
task godoc
- name: Publish docs
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GH_TOKEN }}
publish_dir: ./docs
- run: git fetch --prune --prune-tags
- run: git tag -l 'v*'
- run: ./hack/scripts/changelog.sh > CHANGELOG.md
- name: fetch current version
id: get-current-tag
uses: actions-ecosystem/[email protected]
- uses: peter-evans/create-pull-request@v7
id: cpr
with:
title: 'docs: updated CHANGELOG.md & docs for ${{steps.get-current-tag.outputs.tag }}'
commit-message: |
docs: updated CHANGELOG.md & docs
π€ add release changelog using rebot.
branch: create-pull-request/changelog-${{steps.get-current-tag.outputs.tag }}
delete-branch: true
labels: |
kind/doc
kind/bot
- name: Pull Request Automerge
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v3
with:
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: rebase