Repository navigation
54 lines (49 loc) · 1.61 KB
/
Copy pathrelease.yml
File metadata and controls
54 lines (49 loc) · 1.61 KB
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
name: 标签发布
on:
push:
tags:
- 'v*'
permissions:
contents: read
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
build-test:
name: 构建并验证两平台产物
uses: ./.github/workflows/build-test.yml
release:
name: 发布可执行文件与校验文件
needs: build-test
runs-on: ubuntu-26.04
permissions:
contents: write
steps:
- name: 下载本次运行的 Linux 正式程序
uses: actions/download-artifact@v8.0.1
with:
name: filecrypt-linux-x86_64
path: release/linux
- name: 下载本次运行的 Windows 正式程序
uses: actions/download-artifact@v8.0.1
with:
name: filecrypt-windows-x86_64
path: release/windows
- name: 整理发布文件并计算 SHA-256
shell: bash
run: |
set -euo pipefail
mv release/linux/filecrypt release/filecrypt-linux-x86_64
mv release/windows/filecrypt.exe release/filecrypt-windows-x86_64.exe
chmod +x release/filecrypt-linux-x86_64
cd release
sha256sum filecrypt-linux-x86_64 filecrypt-windows-x86_64.exe > SHA256SUMS
sha256sum --check SHA256SUMS
- name: 创建 GitHub Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_TAG: ${{ github.ref_name }}
run: >-
gh release create "$RELEASE_TAG" --verify-tag --title "$RELEASE_TAG" --generate-notes
release/filecrypt-linux-x86_64 release/filecrypt-windows-x86_64.exe release/SHA256SUMS