Skip to content
52 changes: 52 additions & 0 deletions .github/workflows/build-node-fibers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build node-fibers with prebuilt Node

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

jobs:
build-fibers:
name: Build node-fibers with custom Node
runs-on: ubuntu-latest
strategy:
matrix:
include:
- platform: linux
arch: x64
- platform: linux
arch: arm64

env:
NODE_VERSION: v20.12.0

steps:
- name: Download Node archive
uses: actions/download-artifact@v4
with:
# You must match the exact name used in build-node.yml
name: node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST

- name: Extract Node archive
run: |
mkdir -p node-install
tar -C node-install -xJf node-*.tar.xz
echo "$GITHUB_WORKSPACE/node-install/usr/local/bin" >> $GITHUB_PATH

- name: Checkout node-fibers fork
uses: actions/checkout@v3
with:
repository: asana/node-fibers
ref: jackstrohm_node20_fibers
path: node-fibers

- name: Build node-fibers
working-directory: node-fibers
run: |
which node
node -v
npm install --nodedir="$GITHUB_WORKSPACE/node-install/usr/local"
npm test
87 changes: 87 additions & 0 deletions .github/workflows/build-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Build Node

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

jobs:
build-node:
name: Build ${{ matrix.platform }}-${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- platform: linux
arch: x64
runner: ubuntu-latest
- platform: linux
arch: arm64
runner: ubuntu-latest

env:
S3_BUCKET: your-bucket-name
AWS_REGION: us-east-1

steps:
- name: Checkout Node fork
uses: actions/checkout@v3
with:
repository: Asana/node
path: node
ref: ${{ github.event_name == 'pull_request' && format('refs/pull/{0}/merge', github.event.pull_request.number) || github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Node Version
id: extract-node-version
run: |
NODE_MAJOR_VERSION=$(grep '#define NODE_MAJOR_VERSION' node/src/node_version.h | awk '{print $3}')
NODE_MINOR_VERSION=$(grep '#define NODE_MINOR_VERSION' node/src/node_version.h | awk '{print $3}')
NODE_PATCH_VERSION=$(grep '#define NODE_PATCH_VERSION' node/src/node_version.h | awk '{print $3}')
NODE_VERSION="v${NODE_MAJOR_VERSION}.${NODE_MINOR_VERSION}.${NODE_PATCH_VERSION}"
echo "NODE_VERSION=${NODE_VERSION}" >> $GITHUB_ENV

- name: Set build metadata
id: meta
working-directory: node
run: |
TIMESTAMP=$(date -u +%Y-%m-%dT%H-%M)
SHORT_SHA=$(git rev-parse --short HEAD)
echo "BUILD_ID=${TIMESTAMP}-${SHORT_SHA}" >> $GITHUB_ENV
echo "build_id=${TIMESTAMP}-${SHORT_SHA}" >> $GITHUB_OUTPUT

- name: Install dependencies (Linux)
if: matrix.platform == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y python3 g++ make curl tar xz-utils

- name: Build Node
working-directory: node
run: |
./configure --experimental-enable-pointer-compression
make -j4 install DESTDIR=$GITHUB_WORKSPACE/node-install

- name: Archive Node
run: |
mkdir -p artifacts
FILENAME=node-${NODE_VERSION}-${{ matrix.platform }}-${{ matrix.arch }}-${{ steps.meta.outputs.build_id }}.tar.xz
FILENAME_LATEST=node-${NODE_VERSION}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz
tar -C node-install -cJf artifacts/$FILENAME .
cp artifacts/$FILENAME artifacts/$FILENAME_LATEST
echo "NODE_ARCHIVE=$FILENAME" >> $GITHUB_ENV
echo "NODE_ARCHIVE_LATEST=$FILENAME_LATEST" >> $GITHUB_ENV

- name: Upload Node archive
uses: actions/upload-artifact@v4
with:
name: node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-${{ steps.meta.outputs.build_id }}
path: artifacts/${{ env.NODE_ARCHIVE }}

- name: Upload Node archive latest
uses: actions/upload-artifact@v4
with:
name: node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST
path: artifacts/${{ env.NODE_ARCHIVE_LATEST }}
1 change: 1 addition & 0 deletions tools/dep_updaters/update-openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ help() {
exit "${1:-0}"
}

# shellcheck disable=SC2317
main() {
if [ ${#} -eq 0 ]; then
help 0
Expand Down
Loading