From d808e1b06b4ddf36297922918f2ffd4a952d8751 Mon Sep 17 00:00:00 2001 From: Jack Strohm Date: Thu, 24 Apr 2025 13:01:42 -0700 Subject: [PATCH 1/8] build: adding workflows to build Asana node --- .github/workflows/build-node-fibers.yml | 87 ++++++++++++++++++++ .github/workflows/build-node.yml | 105 ++++++++++++++++++++++++ stage_for_s3.bash | 70 ++++++++++++++++ tools/dep_updaters/update-openssl.sh | 3 +- 4 files changed, 264 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-node-fibers.yml create mode 100644 .github/workflows/build-node.yml create mode 100755 stage_for_s3.bash diff --git a/.github/workflows/build-node-fibers.yml b/.github/workflows/build-node-fibers.yml new file mode 100644 index 00000000000000..697163b712a288 --- /dev/null +++ b/.github/workflows/build-node-fibers.yml @@ -0,0 +1,87 @@ +name: Build node-fibers with prebuilt Node + +on: + workflow_dispatch: + workflow_run: + workflows: [Build Node] + types: + - completed + +jobs: + build-fibers: + 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 + + - 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 + node -p "process.arch" + npm install --nodedir="$GITHUB_WORKSPACE/node-install/usr/local" + npm test || true + rm bin/repl + find . + + - name: Find and archive fibers.node + run: | + # Find the directory under bin/ that contains fibers.node + FIBERS_PATH=$(find ./node-fibers/bin -type f -name fibers.node | head -n1) + FIBERS_DIR=$(dirname "$FIBERS_PATH") + ARCHIVE_NAME=$(basename "$FIBERS_DIR").tar.gz + echo "ARCHIVE_NAME=$ARCHIVE_NAME" >> $GITHUB_ENV + tar -czf "$ARCHIVE_NAME" -C "$(dirname "$FIBERS_DIR")" "$(basename "$FIBERS_DIR")" + + - 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: ${{ env.ARCHIVE_NAME }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build-node.yml b/.github/workflows/build-node.yml new file mode 100644 index 00000000000000..e97959697d3edb --- /dev/null +++ b/.github/workflows/build-node.yml @@ -0,0 +1,105 @@ +name: Build Node + +on: + push: + branches: + - v20.18.3 + - workflows-for-v20.18.3 + pull_request: + paths: .github/workflows/build-node.yml + +jobs: + build-node: + name: Build ${{ matrix.platform }}-${{ matrix.arch }} + 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: + 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 (linux) + working-directory: node + if: matrix.platform == 'linux' + run: | + ./configure --experimental-enable-pointer-compression + make -j4 install DESTDIR=$GITHUB_WORKSPACE/node-install + + - name: Build Node (darwin) + working-directory: node + if: matrix.platform == 'darwin' + run: | + ./configure --experimental-enable-pointer-compression --without-snapshot + make -j2 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 }} + + - name: Upload Node archive to release + uses: softprops/action-gh-release@v1 + with: + name: node-${{ env.NODE_VERSION }}-LATEST + tag_name: node-${{ env.NODE_VERSION }}-release + files: ./artifacts/${{ env.NODE_ARCHIVE_LATEST }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/stage_for_s3.bash b/stage_for_s3.bash new file mode 100755 index 00000000000000..d1642b91543bd0 --- /dev/null +++ b/stage_for_s3.bash @@ -0,0 +1,70 @@ +#!/usr/bin/env bash + +mkdir stage +cd stage || exit + +TIMESTAMP=$(date '+%Y%m%d.%H%M') + +echo "Current timestamp is $TIMESTAMP" + +gh release download -p "*.gz" +gh release download -p "*.xz" + +curl "https://asana-oss-cache.s3.us-east-1.amazonaws.com/node-fibers/fibers-5.0.4.pc.tgz" --output fibers-5.0.4.tar.gz +tar -xzf fibers-5.0.4.tar.gz + +find . -name "*.gz" | while read -r a +do + tar -xzf "$a" -C package/bin + rm "$a" +done + +tar -czf temp.tgz package/ +rm -fr package +SHORT_HASH=$(cat temp.tgz | sha1sum | cut -c1-4) +echo "HASH: $SHORT_HASH" +UNIQUE="pc-${TIMESTAMP}-${SHORT_HASH}" + +mv temp.tgz "fibers-5.0.4-${UNIQUE}.tgz" + +for file in *.tar.xz; do + if [[ "$file" == *-LATEST.tar.xz ]]; then + base="${file%-LATEST.tar.xz}" + new_name="${base}-${UNIQUE}.tar.xz" + + echo "Renaming: $file -> $new_name" + mv "$file" "$new_name" + + if [[ "$new_name" =~ node-v([0-9.]+)-(darwin|linux)-(arm64|x64)-pc.*\.tar\.xz$ ]]; then + version="${BASH_REMATCH[1]}" + os="${BASH_REMATCH[2]}" + arch="${BASH_REMATCH[3]}" + target_dir="node-v${version}-${os}-${arch}" + + echo "Target Dir: $target_dir" + mkdir "$target_dir" + tar -xzf "$new_name" -C "$target_dir" + mv "$target_dir/usr/local/*" "$target_dir" + rm -fr "$target_dir/usr/local" + + tar -cJf "$new_name" "$target_dir" + + rm -fr "$target_dir" + + echo "✅ Done: Archive now contains:" + tar -tf "$new_name" | head + + else + echo "Warning: Skipped $new_name due to unexpected filename format." + fi + fi +done + + +cd .. +mv stage "node-${UNIQUE}" + +echo "Files are in node-${UNIQUE}, please upload to s3" + + + diff --git a/tools/dep_updaters/update-openssl.sh b/tools/dep_updaters/update-openssl.sh index bef379b707a04e..444b5cce272456 100755 --- a/tools/dep_updaters/update-openssl.sh +++ b/tools/dep_updaters/update-openssl.sh @@ -174,7 +174,8 @@ main() { * ) echo "unknown command: $1" help 1 - exit 1 + # shellcheck disable=SC2317 + exit 1 ;; esac } From 897b6c168be9c0e8041a4d6ab6a7c9bc9d213674 Mon Sep 17 00:00:00 2001 From: Kris Buno <106196105+asana-kristoferbuno@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:55:13 -0700 Subject: [PATCH 2/8] Create build-node-openssl-fips-static.yml --- .../build-node-openssl-fips-static.yml | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 .github/workflows/build-node-openssl-fips-static.yml diff --git a/.github/workflows/build-node-openssl-fips-static.yml b/.github/workflows/build-node-openssl-fips-static.yml new file mode 100644 index 00000000000000..2a3a90aa5aad6c --- /dev/null +++ b/.github/workflows/build-node-openssl-fips-static.yml @@ -0,0 +1,110 @@ +name: Build Node with statically-linked FIPS OpenSSL + +on: + push: + branches: + - v20.18.3 + - workflows-for-v20.18.3 + pull_request: + paths: .github/workflows/build-node.yml + +jobs: + build-node: + name: Build ${{ matrix.platform }}-${{ matrix.arch }} with statically-linked FIPS OpenSSL + 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: + 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: Configure OpenSSL + run: | + ./configure --openssl-is-fips + + + - name: Build Node (linux) + working-directory: node + if: matrix.platform == 'linux' + run: | + ./configure --experimental-enable-pointer-compression + make -j4 install DESTDIR=$GITHUB_WORKSPACE/node-install + + - name: Build Node (darwin) + working-directory: node + if: matrix.platform == 'darwin' + run: | + ./configure --experimental-enable-pointer-compression --without-snapshot + make -j2 install DESTDIR=$GITHUB_WORKSPACE/node-install + + - name: Archive Node + run: | + mkdir -p artifacts + FILENAME=node-${NODE_VERSION}-fips-static-${{ matrix.platform }}-${{ matrix.arch }}-${{ steps.meta.outputs.build_id }}.tar.xz + FILENAME_LATEST=node-${NODE_VERSION}-fips-static-${{ 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 }}-fips-static-${{ 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 }}-fips-static-${{ matrix.platform }}-${{ matrix.arch }}-LATEST + path: artifacts/${{ env.NODE_ARCHIVE_LATEST }} + + - name: Upload Node archive to release + uses: softprops/action-gh-release@v1 + with: + name: node-${{ env.NODE_VERSION }}-fips-static-LATEST + tag_name: node-${{ env.NODE_VERSION }}-fips-static-release + files: ./artifacts/${{ env.NODE_ARCHIVE_LATEST }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 07babbf1a05c26288a4dfe2c9b98a4dd564dba89 Mon Sep 17 00:00:00 2001 From: Kris Buno <106196105+asana-kristoferbuno@users.noreply.github.com> Date: Thu, 5 Jun 2025 15:17:39 -0700 Subject: [PATCH 3/8] allow manual trigger --- .github/workflows/build-node-openssl-fips-static.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-node-openssl-fips-static.yml b/.github/workflows/build-node-openssl-fips-static.yml index 2a3a90aa5aad6c..7d10412707c0a7 100644 --- a/.github/workflows/build-node-openssl-fips-static.yml +++ b/.github/workflows/build-node-openssl-fips-static.yml @@ -7,6 +7,7 @@ on: - workflows-for-v20.18.3 pull_request: paths: .github/workflows/build-node.yml + workflow_dispatch: jobs: build-node: From 6c474cabd040e4dce8f3461f3f961c9a5a869bfc Mon Sep 17 00:00:00 2001 From: Kris Buno <106196105+asana-kristoferbuno@users.noreply.github.com> Date: Thu, 5 Jun 2025 15:45:02 -0700 Subject: [PATCH 4/8] add input vars --- .../build-node-openssl-fips-static.yml | 55 ++++++++++++++++--- 1 file changed, 48 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-node-openssl-fips-static.yml b/.github/workflows/build-node-openssl-fips-static.yml index 7d10412707c0a7..98da55fa2f9511 100644 --- a/.github/workflows/build-node-openssl-fips-static.yml +++ b/.github/workflows/build-node-openssl-fips-static.yml @@ -1,13 +1,28 @@ name: Build Node with statically-linked FIPS OpenSSL on: - push: - branches: - - v20.18.3 - - workflows-for-v20.18.3 - pull_request: - paths: .github/workflows/build-node.yml workflow_dispatch: + inputs: + enableFips: + description: 'Whether OpenSSL should be FIPS-enabled' + default: true + type: boolean + dynamicLink: + description: 'If OpenSSL should be dynamically linked with node (rather than statically linked)' + default: false + type: boolean + sharedOpenSSLIncludes: + description: 'dir containing header files for OpenSSL' + default: '' + type: string + sharedOpenSSLLibname: + description: 'libname for dynamically linking to OpenSSL' + default: '' + type: string + sharedOpenSSLLibpath: + description: 'dir for searching for shared OpenSSL dlls' + default: '' + type: string jobs: build-node: @@ -60,10 +75,36 @@ jobs: sudo apt-get update sudo apt-get install -y python3 g++ make curl tar xz-utils - - name: Configure OpenSSL + - name: Configure OpenSSL for fips + id: openssl-is-fips + if: inputs.enableFips run: | ./configure --openssl-is-fips + - name: Dynamically link OpenSSL in Node.js + id: openssl-dynamic-link + if: inputs.dynamicLink + run: | + ./configure --shared-openssl + + - name: Define headers for OpenSSL + id: openssl-dynamic-link-headers + if: ${{ !empty(inputs.sharedOpenSSLIncludes) }} + run: | + ./configure --shared-openssl-includes ${{inputs.sharedOpenSSLIncludes}} + + - name: alternative libname for openssl + id: openssl-dynamic-link-libname + if: ${{ !empty(inputs.sharedOpenSSLLibname) }} + run: | + ./configure --shared-openssl-libname ${{inputs.sharedOpenSSLLibname}} + + - name: Define headers for OpenSSL + id: openssl-dynamic-link-libpath + if: ${{ !empty(inputs.sharedOpenSSLLibpath) }} + run: | + ./configure --shared-openssl-includes ${{inputs.sharedOpenSSLLibpath}} + - name: Build Node (linux) working-directory: node From fd21bda7f8bdc201396c046cb6ee52ab88877082 Mon Sep 17 00:00:00 2001 From: Kris Buno <106196105+asana-kristoferbuno@users.noreply.github.com> Date: Thu, 5 Jun 2025 15:53:22 -0700 Subject: [PATCH 5/8] Update build-node-openssl-fips-static.yml --- .github/workflows/build-node-openssl-fips-static.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-node-openssl-fips-static.yml b/.github/workflows/build-node-openssl-fips-static.yml index 98da55fa2f9511..3d4d502907f1be 100644 --- a/.github/workflows/build-node-openssl-fips-static.yml +++ b/.github/workflows/build-node-openssl-fips-static.yml @@ -1,4 +1,4 @@ -name: Build Node with statically-linked FIPS OpenSSL +name: Build Node with options around OpenSSL dynamic linking and FIPS on: workflow_dispatch: @@ -123,8 +123,8 @@ jobs: - name: Archive Node run: | mkdir -p artifacts - FILENAME=node-${NODE_VERSION}-fips-static-${{ matrix.platform }}-${{ matrix.arch }}-${{ steps.meta.outputs.build_id }}.tar.xz - FILENAME_LATEST=node-${NODE_VERSION}-fips-static-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz + FILENAME=node-${NODE_VERSION}-fips-${{ matrix.platform }}-${{ matrix.arch }}-${{ steps.meta.outputs.build_id }}.tar.xz + FILENAME_LATEST=node-${NODE_VERSION}-fips-${{ 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 @@ -133,13 +133,13 @@ jobs: - name: Upload Node archive uses: actions/upload-artifact@v4 with: - name: node-${{ env.NODE_VERSION }}-fips-static-${{ matrix.platform }}-${{ matrix.arch }}-${{ steps.meta.outputs.build_id }} + name: node-${{ env.NODE_VERSION }}-fips-${{ 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 }}-fips-static-${{ matrix.platform }}-${{ matrix.arch }}-LATEST + name: node-${{ env.NODE_VERSION }}-fips-${{ matrix.platform }}-${{ matrix.arch }}-LATEST path: artifacts/${{ env.NODE_ARCHIVE_LATEST }} - name: Upload Node archive to release From dd54eb8b387acabb60396c5d980e50a5eb7e9461 Mon Sep 17 00:00:00 2001 From: Kris Buno <106196105+asana-kristoferbuno@users.noreply.github.com> Date: Thu, 5 Jun 2025 16:03:31 -0700 Subject: [PATCH 6/8] Update and rename build-node-openssl-fips-static.yml to build-node-openssl-fips.yml --- ...openssl-fips-static.yml => build-node-openssl-fips.yml} | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) rename .github/workflows/{build-node-openssl-fips-static.yml => build-node-openssl-fips.yml} (97%) diff --git a/.github/workflows/build-node-openssl-fips-static.yml b/.github/workflows/build-node-openssl-fips.yml similarity index 97% rename from .github/workflows/build-node-openssl-fips-static.yml rename to .github/workflows/build-node-openssl-fips.yml index 3d4d502907f1be..524f20d42cb787 100644 --- a/.github/workflows/build-node-openssl-fips-static.yml +++ b/.github/workflows/build-node-openssl-fips.yml @@ -23,6 +23,11 @@ on: description: 'dir for searching for shared OpenSSL dlls' default: '' type: string + BUILD_REF: + description: 'ref to build' + required: true + default: 'main' + type: string jobs: build-node: @@ -48,7 +53,7 @@ jobs: 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 }} + ref: ${{ BUILD_REF }} token: ${{ secrets.GITHUB_TOKEN }} - name: Extract Node Version From bcfc2d0d0248857336701364963a2ce13822de8d Mon Sep 17 00:00:00 2001 From: Jack Strohm Date: Tue, 10 Feb 2026 12:52:53 -0800 Subject: [PATCH 7/8] add workflow_dispatch trigger to build-node This enables the manual "Run workflow" button in the GitHub Actions UI. Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) --- .github/workflows/build-node.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-node.yml b/.github/workflows/build-node.yml index e97959697d3edb..b74f4af4973deb 100644 --- a/.github/workflows/build-node.yml +++ b/.github/workflows/build-node.yml @@ -1,6 +1,7 @@ name: Build Node on: + workflow_dispatch: push: branches: - v20.18.3 From 8c820de35f515fb731f90779a206ea668d9d6213 Mon Sep 17 00:00:00 2001 From: Jack Strohm Date: Thu, 5 Mar 2026 14:49:03 -0800 Subject: [PATCH 8/8] Add build-node-packages workflow to main to enable workflow_dispatch --- .github/workflows/build-node-packages.yml | 77 +++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/build-node-packages.yml diff --git a/.github/workflows/build-node-packages.yml b/.github/workflows/build-node-packages.yml new file mode 100644 index 00000000000000..e32ffb0310007d --- /dev/null +++ b/.github/workflows/build-node-packages.yml @@ -0,0 +1,77 @@ +name: Build Node-Packages + +on: + workflow_dispatch: + workflow_run: + workflows: ["Build Node (Standard)"] + types: + - completed + branches: + - v22.21.1 + +jobs: + build-packages: + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} + 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: v22.21.1 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - 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" + mv node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz node.tar.xz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Execute the Dockerfile + run: | + pwd + docker build -t node22_packages_build -f Dockerfile.Packages . + + - name: Extract resources + run: | + docker create --name temp_node_packages_extract node22_packages_build + docker cp temp_node_packages_extract:/usr/src/node/node_modules $GITHUB_WORKSPACE/node_modules + docker rm temp_node_packages_extract + + - name: Tar node-packages + run: | + mkdir -p ./bcrypt@5.1.0/node_modules + mkdir -p ./cld@2.9.1/node_modules + mkdir -p ./unix-dgram@2.0.6/node_modules + mkdir -p "./@datadog+pprof@5.8.0/node_modules/@datadog" + mv node_modules/bcrypt ./bcrypt@5.1.0/node_modules/ + mv node_modules/cld ./cld@2.9.1/node_modules/ + mv node_modules/unix-dgram ./unix-dgram@2.0.6/node_modules/ + mv "node_modules/@datadog/pprof" "./@datadog+pprof@5.8.0/node_modules/@datadog/" + tar --hard-dereference -cvzf packages_${{matrix.arch}}.tar.gz bcrypt@5.1.0 cld@2.9.1 unix-dgram@2.0.6 "@datadog+pprof@5.8.0" + + - 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 }}