Fix Windows natives: separate audio/GLFW DLLs + macos-x86_64 cross-link #80
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: Sonatype Release | |
| on: | |
| push: | |
| branches: [master] | |
| tags: ["*"] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| build-and-publish: | |
| runs-on: macos-latest | |
| name: ${{ startsWith(github.ref, 'refs/tags/') && 'Publish Tag as Release' || 'Publish Snapshot' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: >- | |
| x86_64-apple-darwin, | |
| aarch64-apple-darwin, | |
| x86_64-unknown-linux-gnu, | |
| aarch64-unknown-linux-gnu, | |
| x86_64-pc-windows-msvc, | |
| aarch64-pc-windows-msvc, | |
| aarch64-linux-android, | |
| armv7-linux-androideabi, | |
| x86_64-linux-android | |
| - uses: mlugg/setup-zig@v2 | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ~/.cargo/bin | |
| ~/Library/Caches/cargo-xwin | |
| ~/Library/Caches/cargo-zigbuild | |
| native-components/target | |
| key: rust-macos-all-${{ hashFiles('native-components/Cargo.lock') }} | |
| restore-keys: rust-macos-all- | |
| - name: Install cross-compilation tools | |
| run: | | |
| cargo install cargo-zigbuild || true | |
| cargo install cargo-xwin || true | |
| - name: Install LLVM + lld and add to PATH | |
| run: | | |
| # The `lld` formula (separate from `llvm`) provides lld-link/ld.lld. | |
| brew install llvm lld | |
| echo "$(brew --prefix llvm)/bin" >> $GITHUB_PATH | |
| echo "$(brew --prefix lld)/bin" >> $GITHUB_PATH | |
| # The Windows DLL cross-link needs a recent lld-link: rustup's bundled | |
| # rust-lld crashes parsing the ARM64 Windows SDK import libs. Pin the | |
| # Homebrew lld-link explicitly so build.rs can't fall back to it. | |
| LLD_LINK="$(brew --prefix lld)/bin/lld-link" | |
| ls -l "$LLD_LINK" | |
| echo "SGE_LLD_LINK=$LLD_LINK" >> $GITHUB_ENV | |
| - name: Set up Android NDK | |
| run: | | |
| brew install --cask android-commandlinetools | |
| export ANDROID_HOME="$HOME/Library/Android/sdk" | |
| echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV | |
| yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "ndk;27.2.12479018" || true | |
| - name: Fetch X11 headers (for Linux GLFW cross-compilation) | |
| run: | | |
| chmod +x native-components/vendor/fetch-x11-headers.sh | |
| native-components/vendor/fetch-x11-headers.sh | |
| - name: Build all 6 desktop targets | |
| run: | | |
| chmod +x scripts/cross-all.sh | |
| scripts/cross-all.sh | |
| - name: Download ANGLE shared libraries | |
| run: | | |
| chmod +x scripts/download-angle.sh | |
| scripts/download-angle.sh | |
| - name: Build all 3 Android targets | |
| run: | | |
| chmod +x scripts/cross-android.sh | |
| scripts/cross-android.sh | |
| env: | |
| ANDROID_NDK_HOME: ${{ env.ANDROID_HOME }}/ndk/27.2.12479018 | |
| - uses: coursier/cache-action@v8 | |
| - name: Import GPG key for signing the release | |
| uses: crazy-max/ghaction-import-gpg@v7 | |
| with: | |
| gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
| - uses: coursier/setup-action@v3.0.0 | |
| with: | |
| jvm: "temurin:1.17.0.15" | |
| apps: sbt | |
| - name: Publish all projects | |
| run: sbt ci-release | |
| env: | |
| SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} |