Skip to content

Commit be4be5c

Browse files
docs: 更新 Release 文档,添加 GitHub Actions 说明 (#20)
1 parent dd929f4 commit be4be5c

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

.github/workflows/ci-build.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ on:
44
push:
55
tags:
66
- "*"
7+
workflow_call:
8+
inputs:
9+
tag:
10+
required: true
11+
type: string
12+
713
permissions:
814
contents: read
915
packages: write
@@ -15,11 +21,15 @@ jobs:
1521
runs-on: ubuntu-latest
1622
steps:
1723
- uses: actions/checkout@v4
24+
with:
25+
ref: ${{ inputs.tag || github.ref }}
1826

1927
- name: Set image name
2028
id: image
2129
run: |
2230
echo "name=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
31+
TAG="${{ inputs.tag || github.ref_name }}"
32+
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
2333
2434
- name: Log in to the Container registry
2535
uses: docker/login-action@v3
@@ -38,5 +48,5 @@ jobs:
3848
platforms: linux/amd64
3949
push: true
4050
tags: |
41-
${{ env.REGISTRY }}/${{ steps.image.outputs.name }}:${{ github.ref_name }}
51+
${{ env.REGISTRY }}/${{ steps.image.outputs.name }}:${{ steps.image.outputs.tag }}
4252
${{ env.REGISTRY }}/${{ steps.image.outputs.name }}:latest

.github/workflows/release.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,12 @@ jobs:
4444
generate_release_notes: true
4545
draft: false
4646
prerelease: false
47+
48+
build:
49+
needs: release
50+
uses: ./.github/workflows/ci-build.yml
51+
with:
52+
tag: ${{ inputs.version }}
53+
permissions:
54+
contents: read
55+
packages: write

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,17 @@ build-desktop.bat
9292

9393
## Release
9494

95-
创建新版本发布:
95+
创建新版本发布有两种方式:
96+
97+
### GitHub Actions(推荐)
98+
99+
1. 进入仓库的 [Actions](../../actions) 页面
100+
2. 选择 "Release" workflow
101+
3. 点击 "Run workflow"
102+
4. 输入版本号(如 `v1.0.0`
103+
5. 点击 "Run workflow" 执行
104+
105+
### 本地脚本
96106

97107
```bash
98108
./release.sh <github_token> <version>
@@ -103,4 +113,4 @@ build-desktop.bat
103113
./release.sh ghp_xxxx v1.0.0
104114
```
105115

106-
脚本会自动创建 tag 并推送到 GitHub,然后创建 Release(自动生成 release notes
116+
两种方式都会自动创建 tag 并生成 release notes。

0 commit comments

Comments
 (0)