feat(release): added musl-linked linux builds
Built x64 and arm64 musl release artifacts with matching native addons, Alpine smoke coverage, and installer detection. Fixes #3367
This commit is contained in:
@@ -34,6 +34,10 @@ inputs:
|
||||
cross-arch linux build, or set alone for a host-arch (x64) linux build.
|
||||
required: false
|
||||
default: ""
|
||||
libc:
|
||||
description: Optional Linux libc artifact qualifier (for example, musl)
|
||||
required: false
|
||||
default: ""
|
||||
rust_checks:
|
||||
description: Run clippy/rustfmt checks (only one matrix entry should set this)
|
||||
required: false
|
||||
@@ -135,7 +139,7 @@ runs:
|
||||
|
||||
# --- Rust flags (shared) ------------------------------------------------
|
||||
- name: Configure native Rust flags
|
||||
if: inputs.target == ''
|
||||
if: inputs.target == '' || inputs.arch == 'x64'
|
||||
shell: bash
|
||||
env:
|
||||
TARGET_ARCH: ${{ inputs.arch }}
|
||||
@@ -178,7 +182,7 @@ runs:
|
||||
if: steps.detect.outputs.on_infra == 'false'
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: native-${{ inputs.platform }}-${{ inputs.arch }}-${{ inputs.variant || 'default' }}-h${{ inputs.hash }}
|
||||
shared-key: native-${{ inputs.platform }}-${{ inputs.libc || 'default' }}-${{ inputs.arch }}-${{ inputs.variant || 'default' }}-h${{ inputs.hash }}
|
||||
cache-on-failure: true
|
||||
save-if: ${{ inputs.save_cache == 'true' }}
|
||||
cache-workspace-crates: true
|
||||
@@ -305,7 +309,7 @@ runs:
|
||||
- name: Upload native addon(s)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: pi-natives-${{ inputs.platform }}-${{ inputs.arch }}${{ inputs.variant && format('-{0}', inputs.variant) || '' }}-h${{ inputs.hash }}
|
||||
name: pi-natives-${{ inputs.platform }}-${{ inputs.libc && format('{0}-', inputs.libc) || '' }}${{ inputs.arch }}${{ inputs.variant && format('-{0}', inputs.variant) || '' }}-h${{ inputs.hash }}
|
||||
path: packages/natives/native/pi_natives.${{ inputs.platform }}-${{ inputs.arch }}*.node
|
||||
if-no-files-found: error
|
||||
# Explicit so the native_artifact_lookup canary keeps working even if
|
||||
|
||||
@@ -144,6 +144,8 @@ jobs:
|
||||
# `actions/upload-artifact` `name:` template in build-native action.
|
||||
cross_platform_required=(
|
||||
"pi-natives-linux-arm64-h${hash}"
|
||||
"pi-natives-linux-musl-x64-baseline-h${hash}"
|
||||
"pi-natives-linux-musl-arm64-h${hash}"
|
||||
"pi-natives-darwin-x64-baseline-h${hash}"
|
||||
"pi-natives-darwin-arm64-h${hash}"
|
||||
"pi-natives-win32-x64-baseline-h${hash}"
|
||||
@@ -238,7 +240,7 @@ jobs:
|
||||
# building the artifacts that ship in releases. Skipped on main when
|
||||
# native_artifact_lookup already found a recent run with all artifacts intact.
|
||||
native_cross_platform_kata:
|
||||
name: "Native: ${{ matrix.platform }} ${{ matrix.arch }}"
|
||||
name: "Native: ${{ matrix.platform }} ${{ matrix.libc || '' }} ${{ matrix.arch }}"
|
||||
needs: [release_metadata, native_artifact_lookup]
|
||||
if: ${{ needs.release_metadata.outputs.is-release == 'true' || (github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.native_artifact_lookup.outputs.cross-platform-run-id == '') }}
|
||||
strategy:
|
||||
@@ -246,6 +248,8 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- { os: omp-kata, platform: linux, arch: arm64, target: aarch64-unknown-linux-gnu }
|
||||
- { os: omp-kata, platform: linux, libc: musl, arch: x64, target: x86_64-unknown-linux-musl, variant: baseline }
|
||||
- { os: omp-kata, platform: linux, libc: musl, arch: arm64, target: aarch64-unknown-linux-musl }
|
||||
- { os: omp-kata, platform: win32, arch: x64, target: x86_64-pc-windows-msvc, variant: baseline }
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
@@ -255,6 +259,7 @@ jobs:
|
||||
hash: ${{ needs.native_artifact_lookup.outputs.source-hash }}
|
||||
platform: ${{ matrix.platform }}
|
||||
arch: ${{ matrix.arch }}
|
||||
libc: ${{ matrix.libc }}
|
||||
variant: ${{ matrix.variant }}
|
||||
target: ${{ matrix.target }}
|
||||
glibc: ${{ matrix.platform == 'linux' && env.GLIBC_FLOOR || '' }}
|
||||
@@ -575,6 +580,16 @@ jobs:
|
||||
arch: x64,
|
||||
target_id: linux-x64,
|
||||
binary_path: packages/coding-agent/binaries/omp-linux-x64,
|
||||
native_artifact_pattern: pi-natives-linux-x64-*,
|
||||
}
|
||||
- {
|
||||
os: ubuntu-22.04,
|
||||
platform: linux,
|
||||
libc: musl,
|
||||
arch: x64,
|
||||
target_id: linux-musl-x64,
|
||||
binary_path: packages/coding-agent/binaries/omp-linux-musl-x64,
|
||||
native_artifact_pattern: pi-natives-linux-musl-x64-*,
|
||||
}
|
||||
- {
|
||||
os: ubuntu-24.04-arm,
|
||||
@@ -582,6 +597,16 @@ jobs:
|
||||
arch: arm64,
|
||||
target_id: linux-arm64,
|
||||
binary_path: packages/coding-agent/binaries/omp-linux-arm64,
|
||||
native_artifact_pattern: pi-natives-linux-arm64*,
|
||||
}
|
||||
- {
|
||||
os: ubuntu-24.04-arm,
|
||||
platform: linux,
|
||||
libc: musl,
|
||||
arch: arm64,
|
||||
target_id: linux-musl-arm64,
|
||||
binary_path: packages/coding-agent/binaries/omp-linux-musl-arm64,
|
||||
native_artifact_pattern: pi-natives-linux-musl-arm64*,
|
||||
}
|
||||
- {
|
||||
os: macos-15-intel,
|
||||
@@ -589,6 +614,7 @@ jobs:
|
||||
arch: x64,
|
||||
target_id: darwin-x64,
|
||||
binary_path: packages/coding-agent/binaries/omp-darwin-x64,
|
||||
native_artifact_pattern: pi-natives-darwin-x64*,
|
||||
}
|
||||
- {
|
||||
os: macos-14,
|
||||
@@ -596,6 +622,7 @@ jobs:
|
||||
arch: arm64,
|
||||
target_id: darwin-arm64,
|
||||
binary_path: packages/coding-agent/binaries/omp-darwin-arm64,
|
||||
native_artifact_pattern: pi-natives-darwin-arm64*,
|
||||
}
|
||||
- {
|
||||
os: ubuntu-22.04,
|
||||
@@ -603,6 +630,7 @@ jobs:
|
||||
arch: x64,
|
||||
target_id: win32-x64,
|
||||
binary_path: packages/coding-agent/binaries/omp-windows-x64.exe,
|
||||
native_artifact_pattern: pi-natives-win32-x64*,
|
||||
}
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
@@ -635,7 +663,7 @@ jobs:
|
||||
- name: Download native addon(s)
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
pattern: pi-natives-${{ matrix.platform }}-${{ matrix.arch }}*-h${{ needs.native_artifact_lookup.outputs.source-hash }}
|
||||
pattern: ${{ matrix.native_artifact_pattern }}-h${{ needs.native_artifact_lookup.outputs.source-hash }}
|
||||
path: packages/natives/native
|
||||
merge-multiple: true
|
||||
- name: Build release binary
|
||||
@@ -665,8 +693,17 @@ jobs:
|
||||
runtime_dir="$(mktemp -d)"
|
||||
HOME="$runtime_dir/home" XDG_DATA_HOME="$runtime_dir/xdg" "${{ matrix.binary_path }}" --version
|
||||
HOME="$runtime_dir/home" XDG_DATA_HOME="$runtime_dir/xdg" "${{ matrix.binary_path }}" --smoke-test
|
||||
- name: Smoke musl release binary on Alpine
|
||||
if: matrix.libc == 'musl'
|
||||
run: |
|
||||
binary="$(realpath "${{ matrix.binary_path }}")"
|
||||
docker run --rm -v "$binary:/usr/local/bin/omp:ro" alpine:3.22 sh -c '
|
||||
runtime_dir="$(mktemp -d)"
|
||||
HOME="$runtime_dir/home" XDG_DATA_HOME="$runtime_dir/xdg" omp --version
|
||||
HOME="$runtime_dir/home" XDG_DATA_HOME="$runtime_dir/xdg" omp --smoke-test
|
||||
'
|
||||
- name: Publish native addon package
|
||||
if: ${{ !inputs.skip_npm }}
|
||||
if: ${{ !inputs.skip_npm && matrix.libc != 'musl' }}
|
||||
env:
|
||||
# Fallback auth: setup-node wrote an .npmrc referencing
|
||||
# NODE_AUTH_TOKEN; npm uses it only when OIDC has no trusted
|
||||
|
||||
Reference in New Issue
Block a user