Release Artifacts #4
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 Artifacts | |
| on: | |
| release: | |
| types: | |
| - published | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-upload: | |
| name: Build and upload (${{ matrix.label }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| label: win64 | |
| archive: win64.zip | |
| build_cmd: .\build.bat | |
| archive_cmd: | | |
| $asset = "win64.zip" | |
| Compress-Archive -Path "build\*" -DestinationPath $asset -Force | |
| "asset_path=$asset" >> $env:GITHUB_OUTPUT | |
| - os: ubuntu-latest | |
| label: lin64 | |
| archive: lin64.zip | |
| build_cmd: | | |
| chmod +x ./build.sh | |
| ./build.sh | |
| archive_cmd: | | |
| asset="lin64.zip" | |
| ( | |
| cd build | |
| zip -r "../$asset" . | |
| ) | |
| echo "asset_path=$asset" >> "$GITHUB_OUTPUT" | |
| - os: macos-latest | |
| label: osx | |
| archive: osx.zip | |
| build_cmd: | | |
| chmod +x ./build.sh | |
| ./build.sh | |
| archive_cmd: | | |
| asset="osx.zip" | |
| ( | |
| cd build | |
| zip -r "../$asset" . | |
| ) | |
| echo "asset_path=$asset" >> "$GITHUB_OUTPUT" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Build (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: ${{ matrix.build_cmd }} | |
| - name: Build (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: ${{ matrix.build_cmd }} | |
| - name: Archive build folder (Windows) | |
| if: runner.os == 'Windows' | |
| id: archive_windows | |
| shell: pwsh | |
| run: ${{ matrix.archive_cmd }} | |
| - name: Archive build folder (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| id: archive_unix | |
| shell: bash | |
| run: ${{ matrix.archive_cmd }} | |
| - name: Upload release asset (Windows) | |
| if: runner.os == 'Windows' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.event.release.tag_name }} | |
| files: ${{ steps.archive_windows.outputs.asset_path }} | |
| - name: Upload release asset (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.event.release.tag_name }} | |
| files: ${{ steps.archive_unix.outputs.asset_path }} |