Fix #30
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 | |
| on: | |
| push: | |
| branches: ["main"] | |
| tags: ["v*"] | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| macos_build: | |
| name: MacOS (${{ matrix.OS }}) | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| OS: ["macos-15", "macos-15-intel"] | |
| runs-on: ${{ matrix.OS }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: temurin | |
| cache: sbt | |
| - uses: sbt/setup-sbt@v1 | |
| - name: Build the binary | |
| run: sbt buildBinaryPlatformRelease | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: out/release/* | |
| name: ${{ matrix.os }}-binaries | |
| if-no-files-found: error | |
| linux_build: | |
| name: Linux (${{ matrix.OS }}) | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| OS: ["ubuntu-22.04", "ubuntu-22.04-arm"] | |
| runs-on: ${{ matrix.OS }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: "temurin" | |
| java-version: "21" | |
| cache: "sbt" | |
| - uses: sbt/setup-sbt@v1 | |
| - name: Build the binary | |
| run: sbt buildBinaryPlatformRelease | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: out/release/* | |
| name: ${{ matrix.os }}-linux-binaries | |
| if-no-files-found: error | |
| windows_build: | |
| name: Windows | |
| strategy: | |
| fail-fast: false | |
| runs-on: windows-2022 | |
| env: | |
| LLVM_BIN: 'C:\Program Files\LLVM\bin' | |
| LLVM_VERSION: "20.1.8" | |
| steps: | |
| # This step is important to make sure scalafmt | |
| # checks don't fail | |
| - name: Setup git config | |
| run: git config --global core.autocrlf false | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: "temurin" | |
| java-version: "21" | |
| cache: "sbt" | |
| - uses: sbt/setup-sbt@v1 | |
| # See https://github.com/scala-native/scala-native/blob/master/.github/actions/windows-setup-env/action.yml#L14 SN_RELE | |
| # for details | |
| - name: Configure Pagefile | |
| uses: al-cheb/configure-pagefile-action@v1.2 | |
| with: | |
| minimum-size: 4GB | |
| maximum-size: 16GB | |
| - run: clang -v | |
| shell: cmd | |
| - name: Install clang and SBT | |
| shell: pwsh | |
| run: | | |
| choco install llvm --version="$Env:LLVM_VERSION" --allow-downgrade | |
| choco install sbt --version=1.12.8 | |
| clang --version | |
| - name: Build binary (windows) | |
| run: sbt buildBinaryPlatformRelease | |
| shell: cmd | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: out/release/* | |
| name: windows-binaries | |
| if-no-files-found: error | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: [linux_build, windows_build, macos_build] | |
| name: Upload binaries to release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download binaries | |
| uses: actions/download-artifact@v4 | |
| id: download | |
| with: | |
| path: binaries | |
| - name: List downloaded binaries | |
| run: ls -R binaries | |
| - name: Upload release binaries | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: "${{steps.download.outputs.download-path}}/**/*" |