Trim release package contents #8
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: build | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| tags: | |
| - "v*" | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "9.0.x" | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Ensure BuildDate file | |
| shell: pwsh | |
| run: | | |
| $path = "ReClass.NET/Resources/BuildDate.txt" | |
| if (!(Test-Path $path)) { | |
| New-Item -Force -ItemType Directory (Split-Path $path) | Out-Null | |
| Get-Date -AsUTC -Format "yyyy/MM/dd HH:mm:ss" | Out-File $path | |
| } | |
| - name: Restore | |
| run: msbuild ReClass.NET.sln /t:Restore | |
| - name: Build x86 | |
| run: msbuild ReClass.NET.sln /p:Configuration=Release /p:Platform=x86 /restore | |
| - name: Build x64 | |
| run: msbuild ReClass.NET.sln /p:Configuration=Release /p:Platform=x64 /restore | |
| - name: Package release artifact | |
| if: startsWith(github.ref, 'refs/tags/') | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = "Stop" | |
| $root = "$PWD" | |
| $releaseRoot = Join-Path $root "bin/Release" | |
| Get-ChildItem -Path $releaseRoot -Recurse -Include *.pdb, *.lib, *.exp | Remove-Item -Force | |
| Remove-Item -Force "$releaseRoot/x86/ReClass.NET_Launcher.*" -ErrorAction SilentlyContinue | |
| Remove-Item -Force "$releaseRoot/x64/ReClass.NET_Launcher.*" -ErrorAction SilentlyContinue | |
| $zipPath = Join-Path $root "ReClass.NET-$env:GITHUB_REF_NAME.zip" | |
| if (Test-Path $zipPath) { Remove-Item $zipPath -Force } | |
| Compress-Archive -Path "$releaseRoot/*" -DestinationPath $zipPath | |
| - name: Upload release artifact | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: reclass-release | |
| path: ReClass.NET-${{ github.ref_name }}.zip |