From 9ea2ff5895f4915b6cdb33ae2f09651b557c4926 Mon Sep 17 00:00:00 2001 From: czy Date: Tue, 24 Nov 2026 22:33:45 -0600 Subject: [PATCH] CI: save the packed tarball and its sha256 as an artifact (no publish) After build and tests on the Node 24 leg, npm pack the package, write SHA256SUMS.txt, and upload both as datalyr-api-- (7 days). Skipped for fork PRs. No secrets, no publish step, permissions unchanged. Co-Authored-By: Claude Opus --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d22f1bb..24fd280 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,3 +35,25 @@ jobs: - run: npm ci - run: npm run build - run: npm test + # Package tarball for publishing off a laptop: `npm pack` (no prepack + # script, so it packs the dist/ built above) plus its sha256. Once per + # run (Node 24 leg), and not for fork PRs. + - name: Pack tarball and checksum + id: pack + if: matrix.node == 24 && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) + run: | + set -euo pipefail + VERSION="$(node -p "require('./package.json').version")" + mkdir -p pack-out + TARBALL="$(npm pack --pack-destination pack-out --silent | tail -n 1)" + (cd pack-out && sha256sum "$TARBALL" > SHA256SUMS.txt) + cat pack-out/SHA256SUMS.txt + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + - name: Upload package artifact + if: steps.pack.outcome == 'success' + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: datalyr-api-${{ steps.pack.outputs.version }}-${{ github.event.pull_request.head.sha || github.sha }} + path: pack-out/ + retention-days: 7 + if-no-files-found: error