@@ -102,6 +102,69 @@ jobs:
102102 - name : Test packed-package fixtures
103103 run : npm run test:fixtures
104104
105+ artifact-pack :
106+ name : Pack the CI artifact
107+ runs-on : ubuntu-latest
108+ timeout-minutes : 15
109+ outputs :
110+ sha256 : ${{ steps.pack.outputs.sha256 }}
111+ steps :
112+ - name : Check out the repository
113+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
114+ with :
115+ persist-credentials : false
116+ - name : Set up Node.js 24
117+ uses : actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
118+ with :
119+ node-version : 24.x
120+ cache : npm
121+ - name : Install locked dependencies
122+ run : npm ci
123+ - name : Pack exactly one artifact
124+ id : pack
125+ shell : bash
126+ run : |
127+ set -euo pipefail
128+ mkdir -p ci-artifacts
129+ npm pack --pack-destination ci-artifacts
130+ mapfile -t tarballs < <(find ci-artifacts -maxdepth 1 -type f -name '*.tgz' -print)
131+ if [[ "${#tarballs[@]}" -ne 1 ]]; then
132+ echo "Expected exactly one packed artifact, found ${#tarballs[@]}." >&2
133+ exit 1
134+ fi
135+ echo "sha256=$(sha256sum "${tarballs[0]}" | awk '{ print $1 }')" >> "$GITHUB_OUTPUT"
136+ - name : Upload the packed artifact
137+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
138+ with :
139+ name : ci-npm-package
140+ path : ci-artifacts/*.tgz
141+ if-no-files-found : error
142+
143+ artifact-download :
144+ name : Verify the CI artifact round-trip
145+ needs :
146+ - artifact-pack
147+ runs-on : ubuntu-latest
148+ timeout-minutes : 10
149+ steps :
150+ - name : Download the packed artifact by name
151+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
152+ with :
153+ name : ci-npm-package
154+ path : ci-artifacts
155+ - name : Verify the unique artifact and its digest
156+ env :
157+ EXPECTED_SHA256 : ${{ needs.artifact-pack.outputs.sha256 }}
158+ shell : bash
159+ run : |
160+ set -euo pipefail
161+ mapfile -t tarballs < <(find ci-artifacts -maxdepth 1 -type f -name '*.tgz' -print)
162+ if [[ "${#tarballs[@]}" -ne 1 ]]; then
163+ echo "Expected exactly one downloaded artifact, found ${#tarballs[@]}." >&2
164+ exit 1
165+ fi
166+ echo "$EXPECTED_SHA256 ${tarballs[0]}" | sha256sum --check --strict
167+
105168 minimum-openai :
106169 name : Minimum OpenAI / Node.js 22
107170 runs-on : ubuntu-latest
0 commit comments