fix: prevent home tile hover startup crash #27
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 | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Release version (for example 5.0.0 or v5.0.0)" | |
| required: true | |
| prerelease: | |
| description: "Mark the GitHub release as a prerelease" | |
| required: false | |
| default: false | |
| type: boolean | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Resolve release metadata | |
| id: meta | |
| shell: pwsh | |
| run: | | |
| [xml]$project = Get-Content 'OpenNotes.csproj' | |
| $projectVersion = $project.Project.PropertyGroup.Version | Select-Object -First 1 | |
| if ("${{ github.event_name }}" -eq "workflow_dispatch") { | |
| $inputVersion = "${{ inputs.version }}".Trim() | |
| if ([string]::IsNullOrWhiteSpace($inputVersion)) { | |
| throw "workflow_dispatch requires a version input." | |
| } | |
| $version = $inputVersion.TrimStart('v') | |
| $tag = "v$version" | |
| $prerelease = if ("${{ inputs.prerelease }}" -eq "true") { "true" } else { "false" } | |
| } | |
| else { | |
| $tag = "${{ github.ref_name }}" | |
| $version = $tag.TrimStart('v') | |
| $prerelease = "false" | |
| } | |
| $assemblyVersion = if ($version -match '^\d+\.\d+\.\d+$') { | |
| "$version.0" | |
| } | |
| elseif ($version -match '^\d+\.\d+\.\d+\.\d+$') { | |
| $version | |
| } | |
| else { | |
| throw "Version '$version' must look like x.y.z or x.y.z.w." | |
| } | |
| $portableName = "OpenNotes-Portable-win-x64-$version.zip" | |
| $installerName = "OpenNotes-Setup-$version.exe" | |
| "version=$version" >> $env:GITHUB_OUTPUT | |
| "tag=$tag" >> $env:GITHUB_OUTPUT | |
| "assembly_version=$assemblyVersion" >> $env:GITHUB_OUTPUT | |
| "portable_name=$portableName" >> $env:GITHUB_OUTPUT | |
| "installer_name=$installerName" >> $env:GITHUB_OUTPUT | |
| "prerelease=$prerelease" >> $env:GITHUB_OUTPUT | |
| "project_version=$projectVersion" >> $env:GITHUB_OUTPUT | |
| - name: Create release tag for manual runs | |
| if: github.event_name == 'workflow_dispatch' | |
| shell: pwsh | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| if (git rev-parse "${{ steps.meta.outputs.tag }}" 2>$null) { | |
| throw "Tag ${{ steps.meta.outputs.tag }} already exists." | |
| } | |
| git tag "${{ steps.meta.outputs.tag }}" | |
| git push origin "${{ steps.meta.outputs.tag }}" | |
| - name: Setup .NET 8 | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: "8.0.x" | |
| - name: Install Inno Setup | |
| shell: pwsh | |
| run: choco install innosetup --no-progress -y | |
| - name: Restore | |
| run: dotnet restore .\OpenNotes.csproj | |
| - name: Publish app | |
| shell: pwsh | |
| run: > | |
| dotnet publish .\OpenNotes.csproj | |
| -c Release | |
| -r win-x64 | |
| --self-contained true | |
| -o publish | |
| -p:Version=${{ steps.meta.outputs.version }} | |
| -p:InformationalVersion=${{ steps.meta.outputs.version }} | |
| -p:AssemblyVersion=${{ steps.meta.outputs.assembly_version }} | |
| -p:FileVersion=${{ steps.meta.outputs.assembly_version }} | |
| - name: Build installer | |
| shell: pwsh | |
| run: > | |
| & "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe" .\installer.iss | |
| /DMyAppVersion=${{ steps.meta.outputs.version }} | |
| /DMyAppOutputBaseFilename=OpenNotes-Setup-${{ steps.meta.outputs.version }} | |
| - name: Package portable build | |
| shell: pwsh | |
| run: Compress-Archive -Path .\publish\* -DestinationPath ".\${{ steps.meta.outputs.portable_name }}" -Force | |
| - name: Upload installer artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.meta.outputs.installer_name }} | |
| path: .\installer_output\${{ steps.meta.outputs.installer_name }} | |
| - name: Upload portable artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.meta.outputs.portable_name }} | |
| path: .\${{ steps.meta.outputs.portable_name }} | |
| - name: Publish GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.meta.outputs.tag }} | |
| name: OpenNotes ${{ steps.meta.outputs.version }} | |
| prerelease: ${{ steps.meta.outputs.prerelease }} | |
| generate_release_notes: true | |
| files: | | |
| .\installer_output\${{ steps.meta.outputs.installer_name }} | |
| .\${{ steps.meta.outputs.portable_name }} | |
| - name: Summarize downloads | |
| shell: pwsh | |
| run: | | |
| @" | |
| ## Release outputs | |
| - Installer artifact: `${{ steps.meta.outputs.installer_name }}` | |
| - Portable artifact: `${{ steps.meta.outputs.portable_name }}` | |
| - Release tag: `${{ steps.meta.outputs.tag }}` | |
| "@ >> $env:GITHUB_STEP_SUMMARY |