-
Notifications
You must be signed in to change notification settings - Fork 81
Leverage prebuildify to provide prebuilt addon for npm package #1287
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7277443
Leverage prebuildify to provide prebuilt addon for npm package
minggangw 3768545
Address comments
minggangw d22c41b
Address comments
minggangw e872d09
Add prebuilt binaries
minggangw 94e17e9
Revise README
minggangw 663de2b
Correct supported ROS2 releases
minggangw c2b618c
Add prbuild section into npm README
minggangw 037e562
Address comments
minggangw 8330f4a
Abstract detectUbuntuCodename
minggangw 72e5606
Address comments
minggangw 07a4058
Address comments
minggangw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: Prebuild Linux ARM64 | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| tags: | ||
| - '*' | ||
|
|
||
| jobs: | ||
| prebuild: | ||
| runs-on: ubuntu-24.04-arm | ||
| container: | ||
| image: ${{ matrix.docker_image }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| node-version: [22.X] | ||
| architecture: [arm64] | ||
| ros_distribution: | ||
| - humble | ||
| - jazzy | ||
| - kilted | ||
| include: | ||
| # Humble Hawksbill (May 2022 - May 2027) | ||
| - docker_image: ubuntu:jammy | ||
| ros_distribution: humble | ||
| ubuntu_codename: jammy | ||
| # Jazzy Jalisco (May 2024 - May 2029) | ||
| - docker_image: ubuntu:noble | ||
| ros_distribution: jazzy | ||
| ubuntu_codename: noble | ||
| # Kilted Kaiju (May 2025 - Dec 2026) | ||
| - docker_image: ubuntu:noble | ||
| ros_distribution: kilted | ||
| ubuntu_codename: noble | ||
|
|
||
| steps: | ||
| - name: Setup Node.js ${{ matrix.node-version }} on ${{ matrix.architecture }} | ||
| uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| architecture: ${{ matrix.architecture }} | ||
|
|
||
| - name: Setup ROS2 | ||
| uses: ros-tooling/[email protected] | ||
| with: | ||
| required-ros-distributions: ${{ matrix.ros_distribution }} | ||
|
|
||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Install dependencies | ||
| shell: bash | ||
| run: | | ||
| source /opt/ros/${{ matrix.ros_distribution }}/setup.bash | ||
| npm i | ||
|
|
||
| - name: Generate prebuilt binary | ||
| shell: bash | ||
| run: | | ||
| source /opt/ros/${{ matrix.ros_distribution }}/setup.bash | ||
| npm run prebuild | ||
|
|
||
| - name: Upload prebuilt binary | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: prebuilt-linux-arm64-node${{ matrix.node-version }}-${{ matrix.ubuntu_codename }}-${{ matrix.ros_distribution }} | ||
| path: prebuilds/linux-arm64/*.node | ||
| if-no-files-found: error | ||
|
|
||
| - name: Test loading prebuilt | ||
| shell: bash | ||
| run: | | ||
| source /opt/ros/${{ matrix.ros_distribution }}/setup.bash | ||
| node -e " | ||
| const rclnodejs = require('./index.js'); | ||
| console.log('Successfully loaded rclnodejs with prebuilt binary'); | ||
| console.log('Platform:', process.platform, 'Arch:', process.arch); | ||
| console.log('ROS_DISTRO:', process.env.ROS_DISTRO); | ||
| " |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: Prebuild Linux x64 | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| tags: | ||
| - '*' | ||
|
|
||
| jobs: | ||
| prebuild: | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ${{ matrix.docker_image }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| node-version: [22.X] | ||
| architecture: [x64] | ||
| ros_distribution: | ||
| - humble | ||
| - jazzy | ||
| - kilted | ||
| include: | ||
| # Humble Hawksbill (May 2022 - May 2027) | ||
| - docker_image: ubuntu:jammy | ||
| ros_distribution: humble | ||
| ubuntu_codename: jammy | ||
| # Jazzy Jalisco (May 2024 - May 2029) | ||
| - docker_image: ubuntu:noble | ||
| ros_distribution: jazzy | ||
| ubuntu_codename: noble | ||
| # Kilted Kaiju (May 2025 - Dec 2026) | ||
| - docker_image: ubuntu:noble | ||
| ros_distribution: kilted | ||
| ubuntu_codename: noble | ||
|
|
||
| steps: | ||
| - name: Setup Node.js ${{ matrix.node-version }} on ${{ matrix.architecture }} | ||
| uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| architecture: ${{ matrix.architecture }} | ||
|
|
||
| - name: Setup ROS2 | ||
| uses: ros-tooling/[email protected] | ||
| with: | ||
| required-ros-distributions: ${{ matrix.ros_distribution }} | ||
|
|
||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Install dependencies | ||
| shell: bash | ||
| run: | | ||
| source /opt/ros/${{ matrix.ros_distribution }}/setup.bash | ||
| npm i | ||
|
|
||
| - name: Generate prebuilt binary | ||
| shell: bash | ||
| run: | | ||
| source /opt/ros/${{ matrix.ros_distribution }}/setup.bash | ||
| npm run prebuild | ||
|
|
||
| - name: Upload prebuilt binary | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: prebuilt-linux-x64-node${{ matrix.node-version }}-${{ matrix.ubuntu_codename }}-${{ matrix.ros_distribution }} | ||
| path: prebuilds/linux-x64/*.node | ||
| if-no-files-found: error | ||
|
|
||
| - name: Test loading prebuilt | ||
| shell: bash | ||
| run: | | ||
| source /opt/ros/${{ matrix.ros_distribution }}/setup.bash | ||
| node -e " | ||
| const rclnodejs = require('./index.js'); | ||
| console.log('Successfully loaded rclnodejs with prebuilt binary'); | ||
| console.log('Platform:', process.platform, 'Arch:', process.arch); | ||
| console.log('ROS_DISTRO:', process.env.ROS_DISTRO); | ||
| " |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
[nitpick] Corrected spelling of 'Kilted' to 'Kilted' - this appears to be the correct ROS 2 distribution name, but verify if this should be 'Kilted Kaiju' for clarity.