diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.yml index be39523..a4807a2 100644 --- a/.github/workflows/build-packages.yml +++ b/.github/workflows/build-packages.yml @@ -60,8 +60,19 @@ on: # resolve everything from the same prioritized repo set (patches over # main, see /etc/slackpkg/slackpkg.conf's PRIORITY) keeps every package on # this image on a mutually consistent version set. +# +# actions/checkout and actions/upload-artifact are both Node-based actions +# — Gitea Actions execs their JS bundle with the "node" binary found +# inside the job's own container, it does not inject a runtime of its +# own. Slackware has no nodejs package at all (checked: not in any of the +# main/extra/pasture/testing repos), so the "Install git" step also +# installs a pinned, checksum-verified Node.js release directly from +# nodejs.org — the same style already used for Go/Rust in +# scripts/ci/setup-slackware-buildenv.sh. env: SLACKWARE_IMAGE: "vbatts/slackware:15.0" + NODE_VERSION: "20.20.2" + NODE_SHA256: "df770b2a6f130ed8627c9782c988fda9669fa23898329a61a871e32f965e007d" jobs: build: @@ -72,7 +83,7 @@ jobs: outputs: artifact-name: ${{ steps.artifact-name.outputs.value }} steps: - - name: Install git (needed before actions/checkout can run) + - name: Install git and Node.js (needed before actions/checkout can run) run: | set -eu command -v tar > /dev/null || (echo "!! base image is missing tar — see SLACKWARE_IMAGE in this workflow" && exit 1) @@ -102,6 +113,20 @@ jobs: git --version + # curl isn't installed until scripts/ci/setup-slackware-buildenv.sh + # runs, later — use wget (present in the base image) here instead. + # wget does not consult the system CA bundle on its own (unlike + # curl/git, which respect CURL_CA_BUNDLE/GIT_SSL_CAINFO), so pass + # it explicitly via --ca-certificate. + node_tarball="node-v${NODE_VERSION}-linux-x64.tar.xz" + wget -q --tries=3 --ca-certificate=/etc/ssl/certs/ca-certificates.crt \ + -O "/tmp/$node_tarball" "https://nodejs.org/dist/v${NODE_VERSION}/$node_tarball" + echo "${NODE_SHA256} /tmp/$node_tarball" | sha256sum -c - + mkdir -p /usr/local/lib/nodejs + tar -xf "/tmp/$node_tarball" -C /usr/local/lib/nodejs + echo "/usr/local/lib/nodejs/node-v${NODE_VERSION}-linux-x64/bin" >> "$GITHUB_PATH" + "/usr/local/lib/nodejs/node-v${NODE_VERSION}-linux-x64/bin/node" --version + - uses: actions/checkout@v4 - name: Set up Slackware build environment