add: ChineseSimplified.isl #8
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release TapCaps | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| jobs: | |
| release: | |
| runs-on: windows-latest | |
| env: | |
| SOLUTION_FILE: TapCaps.sln | |
| BUILD_CONFIGURATION: Release | |
| BUILD_PLATFORM: "Any CPU" | |
| steps: | |
| # 1️⃣ Checkout | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # 2️⃣ Setup MSBuild | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@v2 | |
| # 3️⃣ Restore NuGet | |
| - name: Restore NuGet packages | |
| shell: pwsh | |
| run: nuget restore $env:SOLUTION_FILE | |
| # 4️⃣ Build Release | |
| - name: Build | |
| shell: pwsh | |
| run: | | |
| msbuild $env:SOLUTION_FILE ` | |
| /p:Configuration=$env:BUILD_CONFIGURATION ` | |
| /p:Platform="$env:BUILD_PLATFORM" | |
| # 5️⃣ 从 Git tag 注入版本号(给 Inno 用) | |
| - name: Set app version | |
| shell: pwsh | |
| run: | | |
| $version = "${{ github.ref_name }}" | |
| echo "APP_VERSION=$version" >> $env:GITHUB_ENV | |
| Write-Host "APP_VERSION=$version" | |
| # 6️⃣ 安装 Inno Setup(CI 稳定写法) | |
| - name: Install Inno Setup | |
| shell: pwsh | |
| run: | | |
| # 发现异常时报错 | |
| $ErrorActionPreference = 'Stop' | |
| $PSNativeCommandUseErrorActionPreference = $true | |
| curl.exe -OL https://files.jrsoftware.org/is/6/innosetup-6.5.0.exe | |
| .\innosetup-6.5.0.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART | |
| "C:\Program Files (x86)\Inno Setup 6" >> $env:GITHUB_PATH | |
| # 7️⃣ 使用 Inno Setup 生成安装包 | |
| - name: Build installer | |
| shell: pwsh | |
| run: | | |
| iscc Inno/inno_setup.iss | |
| # 8️⃣ 校验安装包是否生成(防翻车) | |
| - name: Verify installer | |
| shell: pwsh | |
| run: | | |
| $path = "Output/TapCaps_Setup_v${{ github.ref_name }}.exe" | |
| if (!(Test-Path $path)) { | |
| Write-Error "Installer not found: $path" | |
| exit 1 | |
| } | |
| Write-Host "Found installer: $path" | |
| # 9️⃣ 只发布 Setup.exe 到 GitHub Releases | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: TapCaps ${{ github.ref_name }} | |
| tag_name: ${{ github.ref_name }} | |
| files: | | |
| Output/TapCaps_Setup_v${{ github.ref_name }}.exe | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |