🐳 chore: 发布新版本 #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: Windows Release | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| permissions: | |
| contents: write | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| build-and-release: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Derive release metadata | |
| id: meta | |
| shell: pwsh | |
| run: | | |
| $tag = "${{ github.ref_name }}" | |
| $version = $tag.TrimStart('v') | |
| "tag=$tag" >> $env:GITHUB_OUTPUT | |
| "version=$version" >> $env:GITHUB_OUTPUT | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| cache: true | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Build Windows release | |
| run: flutter build windows --release | |
| - name: Install Inno Setup | |
| run: choco install innosetup --no-progress -y | |
| - name: Package Windows release | |
| id: package | |
| shell: pwsh | |
| run: | | |
| $tag = "${{ steps.meta.outputs.tag }}" | |
| $archiveDir = Join-Path (Get-Location) "build\release" | |
| $archivePath = Join-Path $archiveDir "pkg_panel-windows-$tag.zip" | |
| if (Test-Path $archivePath) { | |
| Remove-Item -LiteralPath $archivePath -Force | |
| } | |
| New-Item -ItemType Directory -Path $archiveDir -Force | Out-Null | |
| Compress-Archive -Path "build\windows\x64\runner\Release\*" -DestinationPath $archivePath -Force | |
| "archive_path=$archivePath" >> $env:GITHUB_OUTPUT | |
| - name: Build Windows installer | |
| id: installer | |
| shell: pwsh | |
| run: | | |
| $outputDir = Join-Path (Get-Location) "build\installer" | |
| $sourceDir = (Resolve-Path "build\windows\x64\runner\Release").Path | |
| New-Item -ItemType Directory -Path $outputDir -Force | Out-Null | |
| & "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" ` | |
| "/DMyAppVersion=${{ steps.meta.outputs.version }}" ` | |
| "/DMyAppSourceDir=$sourceDir" ` | |
| "/DMyAppOutputDir=$outputDir" ` | |
| "windows\installer.iss" | |
| $installer = Get-ChildItem $outputDir -Filter "*.exe" | | |
| Sort-Object LastWriteTime -Descending | | |
| Select-Object -First 1 -ExpandProperty FullName | |
| "installer_path=$installer" >> $env:GITHUB_OUTPUT | |
| - name: Publish GitHub release | |
| uses: softprops/action-gh-release@v2.5.0 | |
| with: | |
| name: Release ${{ steps.meta.outputs.tag }} | |
| tag_name: ${{ steps.meta.outputs.tag }} | |
| body_path: docs/CHANGELOG.md | |
| files: | | |
| ${{ steps.package.outputs.archive_path }} | |
| ${{ steps.installer.outputs.installer_path }} | |
| fail_on_unmatched_files: true |