Skip to content
Merged
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
77 changes: 77 additions & 0 deletions .github/workflows/build-node-packages.yml
Original file line number Diff line number Diff line change
@@ -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"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see you need to explicitly add it here.

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 }}
Loading