Skip to content

Commit 8495e7f

Browse files
GitHub CopilotCopilot
andcommitted
Update release guide with multi-platform matrix strategy
Replace the single-platform release workflow example with a matrix strategy that produces per-platform artifacts (e.g., engine-linux-x64.tar.gz, engine-darwin-arm64.tar.gz). This reflects the pattern used in practice where engines include platform-specific binaries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2d4fab7 commit 8495e7f

1 file changed

Lines changed: 35 additions & 7 deletions

File tree

docs/integration-guide.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,9 @@ git push origin v1.0.0
909909

910910
### Release Workflow
911911

912-
Add a workflow that triggers on version tags, builds your engine, and attaches the artifact to a GitHub Release.
912+
Add a workflow that triggers on version tags, builds your engine, and attaches the artifact to a GitHub Release. Because engines may include platform-specific binaries (e.g., native CLI tools or compiled extensions), releases should produce **per-platform artifacts** so the correct binary is available at runtime.
913+
914+
Use a **matrix strategy** to build on each target platform and attach a separate tarball per combination (e.g., `engine-linux-x64.tar.gz`, `engine-darwin-arm64.tar.gz`).
913915

914916
> **Note:** The example below is for a Node.js/TypeScript engine. If your engine uses a different runtime (Python, Go, Rust, etc.), substitute the appropriate setup, dependency installation, and build steps, and adjust the artifact paths to match your compiled output.
915917
@@ -927,7 +929,27 @@ permissions:
927929

928930
jobs:
929931
release:
930-
runs-on: ubuntu-latest
932+
strategy:
933+
matrix:
934+
include:
935+
- os: ubuntu-latest
936+
platform: linux
937+
arch: x64
938+
- os: ubuntu-latest
939+
platform: linux
940+
arch: arm64
941+
- os: macos-latest
942+
platform: darwin
943+
arch: arm64
944+
- os: macos-13
945+
platform: darwin
946+
arch: x64
947+
- os: windows-latest
948+
platform: win32
949+
arch: x64
950+
951+
runs-on: ${{ matrix.os }}
952+
931953
steps:
932954
- uses: actions/checkout@v4
933955

@@ -938,18 +960,24 @@ jobs:
938960

939961
- run: npm ci
940962

941-
- run: npm run build
963+
- name: Build
964+
run: npm run build
965+
env:
966+
TARGET_PLATFORM: ${{ matrix.platform }}
967+
TARGET_ARCH: ${{ matrix.arch }}
942968

943969
- name: Create release tarball
944-
run: tar -czf engine.tar.gz engine.yaml dist/
970+
run: tar -czf engine-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz engine.yaml dist/
945971

946-
- name: Create GitHub Release
972+
- name: Upload release asset
947973
uses: softprops/action-gh-release@v2
948974
with:
949-
files: engine.tar.gz
950-
generate_release_notes: true
975+
files: engine-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz
976+
generate_release_notes: ${{ matrix.platform == 'linux' && matrix.arch == 'x64' }}
951977
```
952978
979+
Each matrix job builds for its target platform (using `TARGET_PLATFORM` and `TARGET_ARCH` environment variables) and uploads a named tarball. The result is a single GitHub Release with one artifact per platform.
980+
953981
### What to Include in the Release
954982

955983
Your release artifact must include `engine.yaml` and everything it references. The `entrypoint` in `engine.yaml` is resolved as a relative path, so any files or directories it points to need to be in the tarball alongside it. For example, if your entrypoint is `node dist/index.js`, then `dist/index.js` (and any of its runtime dependencies) must be present.

0 commit comments

Comments
 (0)