Compile blobs #4
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
| on: workflow_dispatch | |
| name: Compile blobs | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| env: | |
| # Actions will be forced to run with Node.js 24 by default starting June 2nd, 2026. | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| build_linux_x64: | |
| name: Build for Linux x64 | |
| # ubuntu-22.04 ships with GLIBC 2.35; ubuntu-20.04 is retired (EOL Apr 2025). | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Build Rust library | |
| run: cd native && cargo build --release | |
| - name: Copy blob | |
| run: cp native/target/release/libmerry.so lib/src/blobs/linux_x64.so | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux_x64 | |
| path: lib/src/blobs/linux_x64.so | |
| build_macos_x64: | |
| name: Build for macOS x64 | |
| # macos-13 (Intel) is retired; cross-compile from macos-latest (ARM) instead. | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-apple-darwin | |
| - name: Build Rust library (x86_64) | |
| run: cd native && cargo build --release --target x86_64-apple-darwin | |
| - name: Copy blob | |
| run: cp native/target/x86_64-apple-darwin/release/libmerry.dylib lib/src/blobs/macos_x64.dylib | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos_x64 | |
| path: lib/src/blobs/macos_x64.dylib | |
| build_macos_arm64: | |
| name: Build for macOS ARM64 | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Build Rust library | |
| run: cd native && cargo build --release | |
| - name: Copy blob | |
| run: cp native/target/release/libmerry.dylib lib/src/blobs/macos_arm64.dylib | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos_arm64 | |
| path: lib/src/blobs/macos_arm64.dylib | |
| build_windows_x64: | |
| name: Build for Windows x64 | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Build Rust library | |
| run: cd native && cargo build --release | |
| shell: bash | |
| # Use PowerShell Copy-Item to avoid the CMD COPY file-lock issue | |
| # that occurs when merry.dll is already open by the Dart runtime. | |
| - name: Copy blob | |
| run: Copy-Item "native\target\release\merry.dll" "lib\src\blobs\windows_x64.dll" -Force | |
| shell: pwsh | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows_x64 | |
| path: lib/src/blobs/windows_x64.dll | |
| make_pr: | |
| name: Open blob update PR | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build_linux_x64 | |
| - build_macos_x64 | |
| - build_macos_arm64 | |
| - build_windows_x64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| merge-multiple: true | |
| path: lib/src/blobs | |
| - run: git status | |
| - uses: peter-evans/create-pull-request@v6 | |
| with: | |
| branch: blobs | |
| title: "ci: update precompiled blobs" | |
| commit-message: "ci: update precompiled blobs" |