V1.5.2.0 Release #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: AVRControl Auto Release | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| on: | |
| push: | |
| branches: [ master ] | |
| permissions: | |
| contents: write | |
| jobs: | |
| check-version: | |
| runs-on: windows-latest | |
| outputs: | |
| version: ${{ steps.get_version.outputs.version }} | |
| is_new: ${{ steps.check_tag.outputs.is_new }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Read version from csproj | |
| id: get_version | |
| shell: pwsh | |
| run: | | |
| [xml]$csproj = Get-Content AVRControl.csproj | |
| $version = $csproj.Project.PropertyGroup.Version | |
| echo "version=$version" >> $env:GITHUB_OUTPUT | |
| - name: Check if version exists | |
| id: check_tag | |
| shell: pwsh | |
| run: | | |
| $tag = "v${{ steps.get_version.outputs.version }}" | |
| $exists = git tag -l $tag | |
| if ($exists) { | |
| echo "is_new=false" >> $env:GITHUB_OUTPUT | |
| echo "Version $tag already exists. Skipping build." | |
| } else { | |
| echo "is_new=true" >> $env:GITHUB_OUTPUT | |
| } | |
| build-and-release: | |
| needs: check-version | |
| if: needs.check-version.outputs.is_new == 'true' | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| profile: [Win-Arm64-Standalone, Win-x64-Dependent, Win-x64-Standalone] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.x' | |
| - name: Publish single EXE via profile | |
| run: dotnet publish AVRControl.csproj -c Release /p:PublishProfile=${{ matrix.profile }} | |
| - name: Zip release files | |
| shell: pwsh | |
| run: | | |
| $zipName = "AVRControl-v${{ needs.check-version.outputs.version }}-${{ matrix.profile }}.zip" | |
| Compress-Archive -Path "**/bin/Release/net10.0-windows7.0/publish/*" -DestinationPath "$zipName" | |
| - name: Compile dynamic release description | |
| id: build_notes | |
| shell: pwsh | |
| run: | | |
| $v = "${{ needs.check-version.outputs.version }}" | |
| $header = @' | |
| 📦 Which version should I download? | |
| To make it easy for everyone, I provide three different versions of AVRControl. Choose the one that fits your system: | |
| 1. Standalone: | |
| File: AVRControl-vVERSION-Win-x64-Standalone.zip | |
| Who is it for? Everyone who wants to "just run it". | |
| Pros: No need to install any .NET runtimes. It contains everything needed to run out of the box. | |
| Cons: Larger download size (~60 MB). | |
| 2. Small / Lightweight: | |
| File: AVRControl-vVERSION-Win-x64-Dependent.zip | |
| Who is it for? Users who already have .NET 10 installed or want a tiny download. | |
| Requirement: | |
| You must have the [.NET 10 Desktop Runtime](https://microsoft.com) installed on your PC. | |
| Pros: Ultra-small file size (< 1 MB). | |
| 3. ARM64 Native (For modern Tablets & Mobile PCs): | |
| File: AVRControl-vVERSION-Win-Arm64-Standalone.zip | |
| Who is it for? Users with ARM-based Windows devices (e.g., Surface Pro 11, Snapdragon X Elite laptops). | |
| Pros: Runs natively on ARM hardware for best performance and battery life. No emulation needed. | |
| '@ | |
| $header = $header.Replace("VERSION", $v) | |
| $changelog = "" | |
| if (Test-Path "README.md") { | |
| $readme = Get-Content "README.md" -Raw | |
| if ($readme -match "(?s)<hr>(.*)") { | |
| $changelog = $Matches[1].Trim() | |
| } | |
| } | |
| $fullBody = $header + "`n`n" + $changelog | |
| $fullBody | Out-File -FilePath "release_notes.txt" -Encoding utf8 | |
| - name: Create GitHub Release and upload ZIP | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ needs.check-version.outputs.version }} | |
| name: Release v${{ needs.check-version.outputs.version }} | |
| body_path: release_notes.txt | |
| draft: false | |
| prerelease: false | |
| files: AVRControl-v${{ needs.check-version.outputs.version }}-${{ matrix.profile }}.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |