diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3231f08..b352f71 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,14 @@ name: Build Prebuilt Binaries on: push: tags: ["v*"] + branches: [main] + paths: + - "native/**" + - ".github/workflows/build.yml" + pull_request: + paths: + - "native/**" + - ".github/workflows/build.yml" workflow_dispatch: permissions: @@ -21,7 +29,7 @@ jobs: libs: "-lm" ext: "" - - os: macos-13 + - os: macos-15-intel platform: darwin-x64 cc: clang flags: "-Wall -Wextra -Wpedantic -O2 -std=c11" @@ -125,3 +133,16 @@ jobs: with: name: all-prebuilds path: prebuilds/ + + - name: Commit prebuilds to repo + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add prebuilds/ + if git diff --cached --quiet; then + echo "No changes to prebuilds" + else + git commit -m "chore: update prebuilt binaries [skip ci]" + git push + fi diff --git a/prebuilds/README.md b/prebuilds/README.md index aa3d18a..efb2a07 100644 --- a/prebuilds/README.md +++ b/prebuilds/README.md @@ -6,15 +6,14 @@ Layout: prebuilds/-/pi-memory[.exe] ``` -## Currently committed in this branch +## Committed platforms - `darwin-arm64/pi-memory` - `darwin-x64/pi-memory` - -## Additional release/CI targets - - `linux-x64/pi-memory` - `linux-arm64/pi-memory` - `win32-x64/pi-memory.exe` +Prebuilds are automatically updated by CI when native code changes. + If a matching prebuilt is not present, `scripts/setup.mjs` compiles from source automatically. diff --git a/prebuilds/linux-arm64/pi-memory b/prebuilds/linux-arm64/pi-memory new file mode 100755 index 0000000..bc50948 Binary files /dev/null and b/prebuilds/linux-arm64/pi-memory differ diff --git a/prebuilds/linux-x64/pi-memory b/prebuilds/linux-x64/pi-memory new file mode 100755 index 0000000..d3b0d9d Binary files /dev/null and b/prebuilds/linux-x64/pi-memory differ diff --git a/prebuilds/win32-x64/pi-memory.exe b/prebuilds/win32-x64/pi-memory.exe new file mode 100644 index 0000000..830c7ba Binary files /dev/null and b/prebuilds/win32-x64/pi-memory.exe differ