|
| 1 | +name: Prebuild Linux ARM64 |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + tags: |
| 7 | + - '*' |
| 8 | + |
| 9 | +jobs: |
| 10 | + prebuild: |
| 11 | + runs-on: ubuntu-24.04-arm |
| 12 | + container: |
| 13 | + image: ${{ matrix.docker_image }} |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + node-version: [22.X] |
| 18 | + architecture: [arm64] |
| 19 | + ros_distribution: |
| 20 | + - humble |
| 21 | + - jazzy |
| 22 | + - kilted |
| 23 | + include: |
| 24 | + # Humble Hawksbill (May 2022 - May 2027) |
| 25 | + - docker_image: ubuntu:jammy |
| 26 | + ros_distribution: humble |
| 27 | + ubuntu_codename: jammy |
| 28 | + # Jazzy Jalisco (May 2024 - May 2029) |
| 29 | + - docker_image: ubuntu:noble |
| 30 | + ros_distribution: jazzy |
| 31 | + ubuntu_codename: noble |
| 32 | + # Kilted Kaiju (May 2025 - Dec 2026) |
| 33 | + - docker_image: ubuntu:noble |
| 34 | + ros_distribution: kilted |
| 35 | + ubuntu_codename: noble |
| 36 | + |
| 37 | + steps: |
| 38 | + - name: Setup Node.js ${{ matrix.node-version }} on ${{ matrix.architecture }} |
| 39 | + uses: actions/setup-node@v5 |
| 40 | + with: |
| 41 | + node-version: ${{ matrix.node-version }} |
| 42 | + architecture: ${{ matrix.architecture }} |
| 43 | + |
| 44 | + - name: Setup ROS2 |
| 45 | + uses: ros-tooling/[email protected] |
| 46 | + with: |
| 47 | + required-ros-distributions: ${{ matrix.ros_distribution }} |
| 48 | + |
| 49 | + - uses: actions/checkout@v5 |
| 50 | + |
| 51 | + - name: Install dependencies |
| 52 | + shell: bash |
| 53 | + run: | |
| 54 | + source /opt/ros/${{ matrix.ros_distribution }}/setup.bash |
| 55 | + npm i |
| 56 | +
|
| 57 | + - name: Generate prebuilt binary |
| 58 | + shell: bash |
| 59 | + run: | |
| 60 | + source /opt/ros/${{ matrix.ros_distribution }}/setup.bash |
| 61 | + npm run prebuild |
| 62 | +
|
| 63 | + - name: Upload prebuilt binary |
| 64 | + uses: actions/upload-artifact@v4 |
| 65 | + with: |
| 66 | + name: prebuilt-linux-arm64-node${{ matrix.node-version }}-${{ matrix.ubuntu_codename }}-${{ matrix.ros_distribution }} |
| 67 | + path: prebuilds/linux-arm64/*.node |
| 68 | + if-no-files-found: error |
| 69 | + |
| 70 | + - name: Test loading prebuilt |
| 71 | + shell: bash |
| 72 | + run: | |
| 73 | + source /opt/ros/${{ matrix.ros_distribution }}/setup.bash |
| 74 | + node -e " |
| 75 | + const rclnodejs = require('./index.js'); |
| 76 | + console.log('Successfully loaded rclnodejs with prebuilt binary'); |
| 77 | + console.log('Platform:', process.platform, 'Arch:', process.arch); |
| 78 | + console.log('ROS_DISTRO:', process.env.ROS_DISTRO); |
| 79 | + " |
0 commit comments