fix(ci): update frontend test command, change report paths #4
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 | |
| on: | |
| push: | |
| branches: [master] | |
| paths: | |
| - ".github/workflows/release.yml" | |
| - "setup.iss" | |
| - "src/LocalTelemetry.App/**" | |
| - "src/LocalTelemetry.Core/**" | |
| - "src/LocalTelemetry.Notifier/**" | |
| permissions: | |
| contents: read | |
| jobs: | |
| release: | |
| name: Build & Release | |
| runs-on: windows-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| attestations: write | |
| steps: | |
| # 0. Generate GitHub App Token for Protected Branch Commit/Push Access | |
| - name: Generate GitHub App Token | |
| id: app_token | |
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| with: | |
| client-id: ${{ secrets.APP_CLIENT_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - name: Checkout Code | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| token: ${{ steps.app_token.outputs.token }} | |
| fetch-depth: 0 | |
| # 1. Setup Bun & Build Svelte Frontend | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| - name: Build Svelte Frontend | |
| run: | | |
| bun install | |
| bun run build | |
| working-directory: src/LocalTelemetry.App/Settings/wwwroot | |
| # 2. Calculate Semantic Version Tag based on Conventional Commits | |
| - name: Generate Version Tag | |
| id: tag_version | |
| uses: mathieudutour/github-tag-action@a22cf08638b34d5badda920f9daf6e72c477b07b # v6.2 | |
| with: | |
| github_token: ${{ steps.app_token.outputs.token }} | |
| tag_prefix: v | |
| dry_run: true | |
| release_branches: main | |
| pre_release_branches: master | |
| default_prerelease_bump: premajor | |
| append_to_pre_release_tag: beta | |
| # 3. Setup .NET 10 & Publish Executable | |
| - name: Setup .NET 10 SDK | |
| uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Publish Single-File Executable | |
| run: dotnet publish src/LocalTelemetry.App/LocalTelemetry.App.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:Version=${{ steps.tag_version.outputs.new_version }} -o ./publish | |
| # 4. Install & Run Inno Setup Compiler | |
| - name: Install Inno Setup & Compile Installer | |
| shell: pwsh | |
| run: | | |
| choco install innosetup --no-progress -y | |
| $iscc = "iscc" | |
| $possiblePaths = @( | |
| "C:\Program Files\Inno Setup 7\ISCC.exe", | |
| "C:\Program Files (x86)\Inno Setup 7\ISCC.exe" | |
| ) | |
| foreach ($path in $possiblePaths) { | |
| if (Test-Path $path) { | |
| $iscc = $path | |
| break | |
| } | |
| } | |
| $ver = "${{ steps.tag_version.outputs.new_version }}" | |
| $numVer = ($ver -split '-')[0] | |
| if ($numVer.Split('.').Count -eq 3) { $numVer = "$numVer.0" } | |
| & $iscc /DAppVersion=$ver /DAppVersionInfoVersion=$numVer setup.iss | |
| # 5. Package Portable Archive & Generate SHA-256 Checksums | |
| - name: Package Portable ZIP & SHA-256 Checksums | |
| shell: pwsh | |
| run: | | |
| Compress-Archive -Path ./publish/* -DestinationPath ./LocalTelemetry-win-x64.zip | |
| Get-FileHash -Path ./LocalTelemetrySetup.exe, ./LocalTelemetry-win-x64.zip -Algorithm SHA256 | Format-Table -AutoSize | Out-String | Set-Content ./checksums.txt | |
| # 6. Generate Cryptographic SLSA Artifact Attestations | |
| - name: Generate Build Artifact Attestations | |
| uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4.2.1 | |
| with: | |
| subject-path: | | |
| ${{ github.workspace }}/LocalTelemetrySetup.exe | |
| ${{ github.workspace }}/LocalTelemetry-win-x64.zip | |
| show-summary: true | |
| # 7. Publish Official GitHub Release | |
| - name: Publish GitHub Release | |
| uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3.0.2 | |
| with: | |
| token: ${{ steps.app_token.outputs.token }} | |
| tag_name: ${{ steps.tag_version.outputs.new_tag }} | |
| name: ${{ steps.tag_version.outputs.new_tag }} | |
| body: ${{ steps.tag_version.outputs.changelog }} | |
| prerelease: true | |
| generate_release_notes: true | |
| files: | | |
| ./LocalTelemetrySetup.exe | |
| ./LocalTelemetry-win-x64.zip | |
| ./checksums.txt |