-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (59 loc) · 2.06 KB
/
release.yaml
File metadata and controls
71 lines (59 loc) · 2.06 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
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 设置 .NET
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
dotnet-version: 10.x
- name: 配置 Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.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: bash
run: |-
curl -o "C:\Program Files (x86)\Inno Setup 6\Languages\ChineseSimplified.isl" "https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/ChineseSimplified.isl"
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