|
| 1 | +name: NPM Publish |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - '*' |
| 7 | + |
| 8 | +# Ensure only one publish runs at a time |
| 9 | +concurrency: |
| 10 | + group: npm-publish |
| 11 | + cancel-in-progress: false |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + |
| 16 | +jobs: |
| 17 | + prebuild-x64: |
| 18 | + uses: ./.github/workflows/prebuild-linux-x64.yml |
| 19 | + |
| 20 | + prebuild-arm64: |
| 21 | + uses: ./.github/workflows/prebuild-linux-arm64.yml |
| 22 | + |
| 23 | + publish: |
| 24 | + needs: [prebuild-x64, prebuild-arm64] |
| 25 | + # Only publish from the official repository, not forks |
| 26 | + if: github.repository == 'RobotWebTools/rclnodejs' |
| 27 | + runs-on: ubuntu-latest |
| 28 | + environment: npm-publish |
| 29 | + permissions: |
| 30 | + contents: read |
| 31 | + id-token: write |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@v5 |
| 34 | + |
| 35 | + - name: Setup Node.js |
| 36 | + uses: actions/setup-node@v6 |
| 37 | + with: |
| 38 | + node-version: 24.x |
| 39 | + registry-url: 'https://registry.npmjs.org' |
| 40 | + |
| 41 | + - name: Download x64 prebuilds |
| 42 | + uses: actions/download-artifact@v4 |
| 43 | + with: |
| 44 | + pattern: prebuilt-linux-x64-* |
| 45 | + path: prebuilds/linux-x64 |
| 46 | + merge-multiple: true |
| 47 | + |
| 48 | + - name: Download arm64 prebuilds |
| 49 | + uses: actions/download-artifact@v4 |
| 50 | + with: |
| 51 | + pattern: prebuilt-linux-arm64-* |
| 52 | + path: prebuilds/linux-arm64 |
| 53 | + merge-multiple: true |
| 54 | + |
| 55 | + - name: List prebuilds |
| 56 | + run: | |
| 57 | + echo "=== x64 prebuilds ===" |
| 58 | + ls -la prebuilds/linux-x64/ |
| 59 | + echo "=== arm64 prebuilds ===" |
| 60 | + ls -la prebuilds/linux-arm64/ |
| 61 | +
|
| 62 | + - name: Pack |
| 63 | + run: ./scripts/npm-pack.sh |
| 64 | + |
| 65 | + - name: Publish |
| 66 | + run: npm publish --provenance --access public ./dist/rclnodejs-*.tgz |
0 commit comments