Release #1
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 | |
| # 推送 v* tag 時自動 build 並發佈 release;也可在 Actions 分頁手動觸發驗證建置 | |
| on: | |
| push: | |
| tags: ['v*'] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: microsoft/setup-msbuild@v2 | |
| - uses: nuget/setup-nuget@v2 | |
| - name: Restore NuGet packages | |
| run: nuget restore KK_personality_changer.sln | |
| - name: Build (Release) | |
| run: msbuild KK_personality_changer.sln /p:Configuration=Release | |
| - name: Package | |
| shell: pwsh | |
| run: | | |
| $out = "KK_personality_changer\bin\Release" | |
| New-Item -ItemType Directory -Path staging\KKPersonalityChanger -Force | Out-Null | |
| Get-ChildItem $out -File | Where-Object { $_.Extension -ne ".pdb" } | Copy-Item -Destination staging\KKPersonalityChanger | |
| Compress-Archive -Path staging\KKPersonalityChanger -DestinationPath KKPersonalityChanger.zip -Force | |
| - name: Upload build artifact (for validation runs) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: KKPersonalityChanger-zip | |
| path: KKPersonalityChanger.zip | |
| - name: Attach to release (tag pushes only) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: KKPersonalityChanger.zip |