Build Release Assets #25
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 Release Assets | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| upload_tag: | |
| description: 'Optional: Release tag to upload to' | |
| required: false | |
| default: '' | |
| type: string | |
| release: | |
| types: [created] | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.os }}-${{ matrix.arch }} | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| matrix: | |
| include: | |
| - runner: macos-latest | |
| os: macos | |
| arch: x86_64 | |
| - runner: macos-latest | |
| os: macos | |
| arch: aarch64 | |
| - runner: ubuntu-latest | |
| os: linux | |
| arch: x86_64 | |
| xvfb: true | |
| - runner: ubuntu-24.04-arm | |
| os: linux | |
| arch: aarch64 | |
| xvfb: true | |
| - runner: windows-latest | |
| os: windows | |
| arch: x86_64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Remove System32 OpenSSL DLLs (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| $system32 = "C:\Windows\System32" | |
| foreach ($dll in @("libcrypto-3-x64.dll", "libssl-3-x64.dll")) { | |
| $path = Join-Path $system32 $dll | |
| if (Test-Path $path) { | |
| Remove-Item -Path $path -Force | |
| Write-Host "Removed $dll from System32" | |
| } else { | |
| Write-Host "$dll not found in System32" | |
| } | |
| } | |
| shell: pwsh | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: '1.11' | |
| - uses: julia-actions/cache@v1 | |
| - name: Install dependencies | |
| run: julia --project=meta -e 'using Pkg; Pkg.instantiate()' | |
| - name: Build | |
| env: | |
| MACOS_PFX_PASSWORD: ${{ secrets.MACOS_PFX_PASSWORD }} | |
| WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASSWORD }} | |
| run: | | |
| ${{ matrix.xvfb && 'xvfb-run -s ''-screen 0 1024x768x24''' || '' }} julia --project=meta meta/build.jl --target-platform=${{ matrix.os }} --target-arch=${{ matrix.arch }} --build-dir=build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.os }}-${{ matrix.arch }} | |
| path: build/* | |
| retention-days: 1 | |
| upload: | |
| name: Upload to release | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: github.event_name == 'release' || github.event.inputs.upload_tag != '' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: ./artifacts | |
| - name: Upload to release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| TAG_NAME="${{ github.event.inputs.upload_tag || github.event.release.tag_name }}" | |
| echo "Uploading to release: $TAG_NAME" | |
| find artifacts/ -type f | while read -r file; do | |
| echo "Uploading: $file" | |
| gh release upload "$TAG_NAME" "$file" | |
| done | |
| echo "All artifacts uploaded successfully!" |