Skip to content
Merged
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
31 changes: 21 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,25 @@ jobs:
- name: 配置 Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: 3.x
python-version: 3.14.x

- name: 安装 Inno Setup 7
shell: pwsh
run: |-
Write-OutPut "[INFO] 卸载 Inno Setup 6"
choco uninstall innosetup
# 这里如果用 WinGet 卸载的话后面 iscc 会变成 C:\ProgramData\Chocolatey\bin\ISCC.exe
# 然后报错:
# Cannot find file at 'c:\program files (x86)\inno setup 6\iscc.exe' (c:\program files (x86)\inno setup 6\iscc.exe). This usually indicates a missing or moved file.

Write-OutPut "[INFO] 安装 Inno Setup 7"
winget install --id JRSoftware.InnoSetup.7 --scope machine -s winget -e
# Chocolatey 上好像没有 InnoSetup 7
# https://community.chocolatey.org/packages?q=innosetup

Write-OutPut "[INFO] 更新 PATH"
"C:\Program Files\Inno Setup 7\" | Out-File -FilePath "$env:GITHUB_PATH" -Append
Write-OutPut "$env:Path"

- name: 更新版本号
shell: bash
Expand All @@ -46,22 +64,15 @@ jobs:
version="${GITHUB_REF_NAME#refs/tags/}"
version="${version#v}"
fi

python ".scripts/update_version.py" "$version"

- name: 发布
run: dotnet publish src/PinAction/PinAction.csproj --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
run: iscc installer.iss

- name: 上传构建文件
if: ${{ github.event_name == 'workflow_dispatch' }}
Expand Down