-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (63 loc) · 2.33 KB
/
Copy pathrelease.yaml
File metadata and controls
76 lines (63 loc) · 2.33 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 版本号 (不带v)
required: true
default: 2.3.3
release:
types: [published]
permissions:
contents: write
jobs:
release:
runs-on: windows-latest
env:
PYTHONIOENCODING: utf-8
steps:
- name: 检出代码
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: 设置 .NET
uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0
with:
dotnet-version: 10.x
- name: 配置 Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: 3.x
- name: 更新版本号
shell: bash
env:
GITHUB_EVENT_INPUTS_VERSION: ${{ github.event.inputs.version }}
run: |-
if [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then
version="${GITHUB_EVENT_INPUTS_VERSION#v}"
else
version="${GITHUB_REF_NAME#refs/tags/}"
version="${version#v}"
fi
python ".scripts/update_version.py" "$version"
- name: 发布
run: dotnet publish PinAction --configuration Release
- name: 打包安装程序
shell: pwsh
run: |-
Write-Host "通过 GitHub API 下载中文翻译..."
$apiUrl = "https://api.github.com/repos/jrsoftware/issrc/contents/Files/Languages/ChineseSimplified.isl?ref=main"
$downloadPath = "C:\Program Files (x86)\Inno Setup 6\Languages\ChineseSimplified.isl"
Invoke-WebRequest -Uri $apiUrl -Headers @{ "Accept" = "application/vnd.github.raw+json" } -OutFile $downloadPath
Get-FileHash -Path $downloadPath -Algorithm SHA256
iscc installer.iss
- name: 上传构建文件
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
path: Release/PinAction_Setup.exe
- name: 发布至发行版
env:
GH_TOKEN: ${{ github.token }}
if: ${{ github.event_name != 'workflow_dispatch' }}
run: gh release upload "$env:GITHUB_REF_NAME" "Release/PinAction_Setup.exe" --clobber