Fix bundled .NET runtime config #31
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: Stable Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| - name: Install Python dependencies | |
| run: pip install -r requirements.txt | |
| - name: Install Velopack CLI | |
| run: | | |
| dotnet tool install -g vpk | |
| echo "$HOME\.dotnet\tools" >> $env:GITHUB_PATH | |
| - name: Build All | |
| run: python makefile.py --build-all --stable | |
| - name: Validate Velopack hooks | |
| shell: pwsh | |
| run: | | |
| Push-Location Hammer5Tools | |
| if (Test-Path .\Hammer5Tools.exe) { | |
| & .\Hammer5Tools.exe --velopack-install | |
| & .\Hammer5Tools.exe --squirrel-install | |
| } elseif (Test-Path .\app\Hammer5Tools.exe) { | |
| & .\app\Hammer5Tools.exe --velopack-install | |
| & .\app\Hammer5Tools.exe --squirrel-install | |
| } else { | |
| Write-Host 'Hammer5Tools.exe not found; unable to test hooks. Directory content:' | |
| Get-ChildItem -Recurse | |
| exit 1 | |
| } | |
| Pop-Location | |
| - name: Read app version | |
| id: version | |
| run: | | |
| $ver = python -c "from src.common import app_version; print(app_version)" | |
| echo "app_version=$ver" >> $env:GITHUB_OUTPUT | |
| - name: Get Release Notes | |
| shell: pwsh | |
| run: | | |
| if (Test-Path "RELEASE_NOTES.md") { | |
| # On Windows, Copy-Item fails if names differ only by case. | |
| # We'll normalize to lowercase using Rename-Item if needed. | |
| if ((Get-Item "RELEASE_NOTES.md").Name -cne "release_notes.md") { | |
| Rename-Item "RELEASE_NOTES.md" "release_notes.md" -ErrorAction SilentlyContinue | |
| } | |
| Write-Host "Using existing RELEASE_NOTES.md file." | |
| } else { | |
| "## Hammer5Tools ${{ github.ref_name }}`nRelease ${{ github.ref_name }}." | | |
| Out-File release_notes.md -Encoding utf8 | |
| Write-Host "Using default release notes." | |
| } | |
| - name: Velopack Pack | |
| run: | | |
| & "$HOME\.dotnet\tools\vpk.exe" pack --packId Hammer5Tools --packVersion ${{ steps.version.outputs.app_version }} --packDir Hammer5Tools --mainExe Hammer5Tools.exe --icon src/appicon.ico --channel stable --noPortable --releaseNotes release_notes.md --framework net9.0-x64-desktop | |
| - name: Velopack Upload | |
| run: | | |
| & "$HOME\.dotnet\tools\vpk.exe" upload github --repoUrl https://github.com/dertwist/Hammer5Tools --publish --token ${{ secrets.GITHUB_TOKEN }} --channel stable --tag ${{ github.ref_name }} | |
| - name: Update GitHub Release Description | |
| run: gh release edit ${{ github.ref_name }} --notes-file release_notes.md | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |