Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build-node-fibers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
workflows: [Build Node]
types:
- completed
pull_request:
paths: .github/workflows/build-node-fibers.yml

jobs:
build-fibers:
Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/build-node-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Build node-packages with prebuilt Node

on:
workflow_dispatch:
workflow_run:
workflows: [Build Node]
types:
- completed
pull_request:
paths: .github/workflows/build-node-packages.yml

jobs:
build-packages:
strategy:
matrix:
include:
- platform: linux
arch: x64
runs_on: ubuntu-22.04
- platform: linux
arch: arm64
runs_on: ubuntu-22.04-arm
runs-on: ${{ matrix.runs_on }}

env:
NODE_VERSION: v20.18.3

steps:
- name: Debug Matrix Values
run: |
echo "Matrix platform: ${{ matrix.platform }}"
echo "Matrix arch: ${{ matrix.arch }}"

- name: Download Node archive
run: |
gh release download node-${{ env.NODE_VERSION }}-release \
--repo asana/node \
--pattern "node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Node archive
run: |
mkdir -p node-install
tar -C node-install -xJf node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz
echo "$GITHUB_WORKSPACE/node-install/usr/local/bin" >> $GITHUB_PATH

- name: Verify Node Binary Architecture
run: |
echo "Node File:"
file $GITHUB_WORKSPACE/node-install/usr/local/bin/node
echo "Runner architecture:"
uname -m
which node
node -v
node -p "process.arch"
ls

- name: Build node-packages bcrypt
run: |
npm i --nodedir="$GITHUB_WORKSPACE/node-install/usr/local" [email protected]
mkdir [email protected]
mkdir [email protected]/node_modules

- name: Build node-packages cld
run: |
npm i --nodedir="$GITHUB_WORKSPACE/node-install/usr/local" [email protected]
mkdir [email protected]
mkdir [email protected]/node_modules

- name: Build node-packages unix-dgram
run: |
npm i --nodedir="$GITHUB_WORKSPACE/node-install/usr/local" [email protected]
mkdir [email protected]
mkdir [email protected]/node_modules

- name: Tar node-packages
run: |
mv node_modules/bcrypt ./[email protected]/node_modules/bcrypt
mv node_modules/cld ./[email protected]/node_modules/cld
mv node_modules/unix-dgram ./[email protected]/node_modules/unix-dgram
tar --hard-dereference -cvzf packages_${{matrix.arch}}.tar.gz [email protected] [email protected] [email protected]

- name: Upload archive to release
uses: softprops/action-gh-release@v1
with:
name: node-${{ env.NODE_VERSION }}-LATEST
tag_name: node-${{ env.NODE_VERSION }}-release
files: packages_${{matrix.arch}}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 1 addition & 4 deletions .github/workflows/build-node.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Build Node

on:
push:
branches:
- v20.18.3
- workflows-for-v20.18.3
workflow_dispatch:
pull_request:
paths: .github/workflows/build-node.yml

Expand Down