-
Notifications
You must be signed in to change notification settings - Fork 5
Add linux-arm64 npm packaging #310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,7 @@ env: | |
| # Comma-delimited npm package names that have not yet been published and | ||
| # therefore cannot have a trusted publisher configured. Remove each package | ||
| # in a follow-up PR after its first release and trusted-publisher setup. | ||
| FIRST_TIME_PACKAGES: ",@hyperlight-dev/js-host-api-darwin-arm64," | ||
| FIRST_TIME_PACKAGES: ",@hyperlight-dev/js-host-api-darwin-arm64,@hyperlight-dev/js-host-api-linux-arm64-gnu," | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
@@ -64,6 +64,9 @@ jobs: | |
| - target: aarch64-apple-darwin | ||
| os: macos-15 | ||
| build_name: darwin-arm64 | ||
| - target: aarch64-unknown-linux-gnu | ||
| os: [self-hosted, Linux, arm64, kvm] | ||
| build_name: linux-arm64-gnu | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
|
|
@@ -213,6 +216,12 @@ jobs: | |
| name: bindings-darwin-arm64 | ||
| path: ${{ env.WORKING_DIR }}/artifacts/darwin-arm64 | ||
|
|
||
| - name: Download Linux arm64 GNU artifact | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| name: bindings-linux-arm64-gnu | ||
| path: ${{ env.WORKING_DIR }}/artifacts/linux-arm64-gnu | ||
|
|
||
| - name: Download JS bindings | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
|
|
@@ -230,10 +239,12 @@ jobs: | |
| mv artifacts/linux-x64-musl/*.node npm/linux-x64-musl/js-host-api.linux-x64-musl.node | ||
| mv artifacts/win32-x64-msvc/*.node npm/win32-x64-msvc/js-host-api.win32-x64-msvc.node | ||
| mv artifacts/darwin-arm64/*.node npm/darwin-arm64/js-host-api.darwin-arm64.node | ||
| mv artifacts/linux-arm64-gnu/*.node npm/linux-arm64-gnu/js-host-api.linux-arm64-gnu.node | ||
| ls -la npm/linux-x64-gnu/ | ||
| ls -la npm/linux-x64-musl/ | ||
| ls -la npm/win32-x64-msvc/ | ||
| ls -la npm/darwin-arm64/ | ||
| ls -la npm/linux-arm64-gnu/ | ||
|
|
||
| - name: Set package versions | ||
| working-directory: ${{ env.WORKING_DIR }} | ||
|
|
@@ -246,6 +257,7 @@ jobs: | |
| cd ../linux-x64-musl && npm version "$VERSION" --no-git-tag-version --allow-same-version | ||
| cd ../win32-x64-msvc && npm version "$VERSION" --no-git-tag-version --allow-same-version | ||
| cd ../darwin-arm64 && npm version "$VERSION" --no-git-tag-version --allow-same-version | ||
| cd ../linux-arm64-gnu && npm version "$VERSION" --no-git-tag-version --allow-same-version | ||
| env: | ||
| VERSION: ${{ inputs.version }} | ||
|
|
||
|
|
@@ -325,6 +337,13 @@ jobs: | |
| env: | ||
| NODE_AUTH_TOKEN: ${{ (github.event_name == 'workflow_dispatch' || contains(env.FIRST_TIME_PACKAGES, ',@hyperlight-dev/js-host-api-darwin-arm64,')) && secrets.NPM_TOKEN || '' }} | ||
|
|
||
| - name: Publish Linux arm64 GNU package | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we install and smoke-test the Linux ARM64 release tarball on an ARM64 runner before publishing? test-pack.sh only validates the x64 GNU package. The ARM64 source-build tests do not cover installation from the tarball. |
||
| if: ${{ !inputs.dry_run }} | ||
| working-directory: ${{ env.WORKING_DIR }}/npm/linux-arm64-gnu | ||
| run: npm publish --access public --ignore-scripts ${{ (github.event_name == 'workflow_dispatch' || contains(env.FIRST_TIME_PACKAGES, ',@hyperlight-dev/js-host-api-linux-arm64-gnu,')) && '' || '--provenance' }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This expression always produces --provenance because the empty string is falsy. |
||
| env: | ||
| NODE_AUTH_TOKEN: ${{ (github.event_name == 'workflow_dispatch' || contains(env.FIRST_TIME_PACKAGES, ',@hyperlight-dev/js-host-api-linux-arm64-gnu,')) && secrets.NPM_TOKEN || '' }} | ||
|
|
||
| - name: Publish main package | ||
| if: ${{ !inputs.dry_run }} | ||
| working-directory: ${{ env.WORKING_DIR }} | ||
|
|
@@ -342,7 +361,8 @@ jobs: | |
| "@hyperlight-dev/js-host-api-linux-x64-gnu" \ | ||
| "@hyperlight-dev/js-host-api-linux-x64-musl" \ | ||
| "@hyperlight-dev/js-host-api-win32-x64-msvc" \ | ||
| "@hyperlight-dev/js-host-api-darwin-arm64"; do | ||
| "@hyperlight-dev/js-host-api-darwin-arm64" \ | ||
| "@hyperlight-dev/js-host-api-linux-arm64-gnu"; do | ||
| if npm view "$pkg@$VERSION" version > /dev/null 2>&1; then | ||
| echo "✅ $pkg@$VERSION published" | ||
| else | ||
|
|
@@ -375,5 +395,8 @@ jobs: | |
| echo "--- @hyperlight-dev/js-host-api-darwin-arm64 ---" | ||
| npm pack ./npm/darwin-arm64 --dry-run | ||
| echo "" | ||
| echo "--- @hyperlight-dev/js-host-api-linux-arm64-gnu ---" | ||
| npm pack ./npm/linux-arm64-gnu --dry-run | ||
| echo "" | ||
| echo "--- @hyperlight-dev/js-host-api ---" | ||
| npm pack --dry-run | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| "name": "@hyperlight-dev/js-host-api-linux-arm64-gnu", | ||
| "version": "0.4.0", | ||
| "os": [ | ||
| "linux" | ||
| ], | ||
| "cpu": [ | ||
| "arm64" | ||
| ], | ||
| "main": "js-host-api.linux-arm64-gnu.node", | ||
| "files": [ | ||
| "js-host-api.linux-arm64-gnu.node" | ||
| ], | ||
| "description": "Node.js API bindings for Hyperlight JS - Linux arm64 gnu", | ||
| "license": "Apache-2.0", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/hyperlight-dev/hyperlight-js.git" | ||
| }, | ||
| "homepage": "https://github.com/hyperlight-dev/hyperlight-js#readme", | ||
| "bugs": { | ||
| "url": "https://github.com/hyperlight-dev/hyperlight-js/issues" | ||
| }, | ||
| "engines": { | ||
| "node": ">= 18" | ||
| }, | ||
| "libc": [ | ||
| "glibc" | ||
| ] | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you clarify why this change is needed? Upstream PR hyperlight-dev/hyperlight#1794 targets virtq-foundations and has CI runs despite retaining the branch filter. Also, checks against the old base do not validate the merge with the new base after retargeting.