Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ on:
push:
tags:
- "*"
workflow_call:
inputs:
tag:
required: true
type: string

permissions:
contents: read
packages: write
Expand All @@ -15,11 +21,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}

- name: Set image name
id: image
run: |
echo "name=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
TAG="${{ inputs.tag || github.ref_name }}"
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"

- name: Log in to the Container registry
uses: docker/login-action@v3
Expand All @@ -38,5 +48,5 @@ jobs:
platforms: linux/amd64
push: true
tags: |
${{ env.REGISTRY }}/${{ steps.image.outputs.name }}:${{ github.ref_name }}
${{ env.REGISTRY }}/${{ steps.image.outputs.name }}:${{ steps.image.outputs.tag }}
${{ env.REGISTRY }}/${{ steps.image.outputs.name }}:latest
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,12 @@ jobs:
generate_release_notes: true
draft: false
prerelease: false

build:
needs: release
uses: ./.github/workflows/ci-build.yml
with:
tag: ${{ inputs.version }}
permissions:
contents: read
packages: write
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,17 @@ build-desktop.bat

## Release

创建新版本发布:
创建新版本发布有两种方式:

### GitHub Actions(推荐)

1. 进入仓库的 [Actions](../../actions) 页面
2. 选择 "Release" workflow
3. 点击 "Run workflow"
4. 输入版本号(如 `v1.0.0`)
5. 点击 "Run workflow" 执行

### 本地脚本

```bash
./release.sh <github_token> <version>
Expand All @@ -103,4 +113,4 @@ build-desktop.bat
./release.sh ghp_xxxx v1.0.0
```

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