fix(bundle): fall back to building linuxdevel/sandbox-runtime if dist… #11
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 | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-release: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| bundle_target: linux-x64 | |
| - os: macos-15 | |
| bundle_target: darwin-arm64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build sandbox-runtime from source | |
| run: | | |
| git clone --depth 1 https://github.com/linuxdevel/sandbox-runtime /tmp/sandbox-runtime | |
| npm --prefix /tmp/sandbox-runtime install | |
| npm --prefix /tmp/sandbox-runtime run build | |
| SRT_DIR=$(find node_modules/.pnpm -maxdepth 4 -path "*/@anthropic-ai/sandbox-runtime" -type d | head -1) | |
| cp -r /tmp/sandbox-runtime/dist "$SRT_DIR/" | |
| - name: Run tests | |
| run: pnpm test | |
| - name: Build and bundle | |
| run: pnpm bundle | |
| env: | |
| BUNDLE_TARGET: ${{ matrix.bundle_target }} | |
| - name: Install musl-tools | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y musl-tools | |
| - name: Build native sandbox helper | |
| if: runner.os == 'Linux' | |
| run: make -C native | |
| - name: Prepare release assets (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| cp native/safeclaw-sandbox-helper safeclaw-sandbox-helper-linux-x86_64 | |
| sha256sum safeclaw-${{ matrix.bundle_target }}.tar.gz safeclaw-sandbox-helper-linux-x86_64 > SHA256SUMS | |
| - name: Upload release assets (Linux) | |
| if: runner.os == 'Linux' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{ github.ref_name }} | |
| files: | | |
| safeclaw-${{ matrix.bundle_target }}.tar.gz | |
| safeclaw-sandbox-helper-linux-x86_64 | |
| SHA256SUMS | |
| generate_release_notes: true | |
| - name: Upload release assets (macOS) | |
| if: runner.os == 'macOS' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{ github.ref_name }} | |
| files: | | |
| safeclaw-${{ matrix.bundle_target }}.tar.gz | |
| generate_release_notes: false |