GitHub:v0.9.1 #22
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: GitHub Release | |
| run-name: GitHub:${{ github.ref_name }} | |
| permissions: | |
| contents: write | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'v[0-9].[0-9].[0-9]*' | |
| - 'v[0-9].[0-9].[0-9][0-9]*' | |
| - 'v[0-9].[0-9][0-9].[0-9]*' | |
| - 'v[0-9].[0-9][0-9].[0-9][0-9]*' | |
| - 'v[0-9][0-9].[0-9].[0-9]*' | |
| - 'v[0-9][0-9].[0-9].[0-9][0-9]*' | |
| - 'v[0-9][0-9].[0-9][0-9].[0-9]*' | |
| - 'v[0-9][0-9].[0-9][0-9].[0-9][0-9]*' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build-and-release: | |
| name: Build & Release | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable-x86_64-pc-windows-msvc | |
| - name: Install Inno Setup | |
| shell: pwsh | |
| run: | | |
| $ISCC = "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe" | |
| if (Test-Path $ISCC) { | |
| Write-Host "Inno Setup already installed: $ISCC" | |
| } else { | |
| Write-Host "Downloading Inno Setup 6.7.3..." | |
| Invoke-WebRequest -Uri "https://github.com/jrsoftware/issrc/releases/download/is-6_7_3/innosetup-6.7.3.exe" -OutFile "$env:TEMP\innosetup.exe" | |
| Write-Host "Installing Inno Setup..." | |
| & "$env:TEMP\innosetup.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- | |
| Start-Sleep -Seconds 5 | |
| } | |
| - name: Build Release | |
| run: cargo build --release | |
| - name: Get Version | |
| id: get_version | |
| shell: pwsh | |
| run: | | |
| if ("${{ github.ref }}" -like "refs/tags/*") { | |
| $version = $env:GITHUB_REF -replace "refs/tags/v", "" | |
| } else { | |
| # If manually triggered without a tag, fallback to Cargo.toml version (simplified handling) | |
| $version = (Get-Content Cargo.toml | Select-String "^version =" | ForEach-Object { $_.ToString().Split('"')[1] }) | |
| } | |
| echo "VERSION=$version" >> $env:GITHUB_OUTPUT | |
| Write-Host "Version: $version" | |
| - name: Prepare Assets | |
| shell: pwsh | |
| run: | | |
| .\build\actions\github_release_prepare.ps1 -Version "${{ steps.get_version.outputs.VERSION }}" | |
| - name: Release | |
| if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| target/release/WSLDashboard.${{ steps.get_version.outputs.VERSION }}.Portable.x64.zip | |
| build/releases/WSLDashboard.${{ steps.get_version.outputs.VERSION }}.Setup.x64.zip | |
| build/releases/WSLDashboard.${{ steps.get_version.outputs.VERSION }}.Setup.x64.exe | |
| generate_release_notes: true | |