@@ -50,14 +50,16 @@ jobs:
5050 needs : admission
5151 runs-on : ubuntu-24.04
5252 timeout-minutes : 20
53+ env :
54+ PYLON_RELEASE_MODE : preview
5355 permissions :
5456 contents : read
5557 strategy :
5658 fail-fast : false
5759 matrix :
5860 copy : [a, b]
5961 steps :
60- - name : Checkout exact pushed source
62+ - name : Checkout exact source
6163 uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
6264 with :
6365 ref : ${{ github.sha }}
@@ -69,41 +71,29 @@ jobs:
6971 with :
7072 node-version : ${{ env.PYLON_RELEASE_NODE }}
7173
72- - name : Install pinned build inputs
74+ - name : Run isolated release sandbox
75+ id : sandbox
76+ shell : /usr/bin/bash --noprofile --norc -euo pipefail {0}
7377 run : |
74- sudo apt-get update
75- sudo apt-get install -y libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
76- npm install --global "npm@${PYLON_RELEASE_NPM}"
77- test "$(node --version)" = "v${PYLON_RELEASE_NODE}"
78- test "$(npm --version)" = "${PYLON_RELEASE_NPM}"
79- npm ci
78+ node_path="$(node -e 'process.stdout.write(require("node:fs").realpathSync.native(process.execPath))')"
79+ /usr/bin/env -i \
80+ "HOME=/tmp" \
81+ "PATH=${node_path%/*}:/usr/bin:/bin" \
82+ "$node_path" "$GITHUB_WORKSPACE/scripts/run-pylon-release-sandbox.mjs" \
83+ --task pack \
84+ --mode "$PYLON_RELEASE_MODE" \
85+ --host-os "${{ runner.os }}" \
86+ --workspace "$GITHUB_WORKSPACE" \
87+ --github-output "$GITHUB_OUTPUT" \
88+ --run-id "${{ github.run_id }}" \
89+ --run-number "${{ github.run_number }}" \
90+ --publication-policy-revision 3
8091
81- - name : Test publication contract
82- run : |
83- npm run test:pylon-release
84- npm run test:pylon-publication
85-
86- - name : Build and pack without network
87- run : |
88- sudo env \
89- "PATH=$PATH" \
90- "HOME=$HOME" \
91- "GIT_CONFIG_COUNT=1" \
92- "GIT_CONFIG_KEY_0=safe.directory" \
93- "GIT_CONFIG_VALUE_0=$GITHUB_WORKSPACE" \
94- unshare --net -- npm run release:pylon:pack
95-
96- - name : Verify and prepare six exact subjects
97- run : |
98- npm run release:pylon:verify
99- npm run release:pylon:preview -- --publication-policy-revision 2
100- npm run release:pylon:verify-preview
101-
102- - name : Upload isolated preview subjects
92+ - name : Upload isolated subjects
10393 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
10494 with :
10595 name : pylon-preview-pack-${{ matrix.copy }}
106- path : .npm/pylon-release/artifacts
96+ path : ${{ steps.sandbox.outputs.artifact_dir }}
10797 include-hidden-files : true
10898 if-no-files-found : error
10999 retention-days : 3
@@ -183,6 +173,8 @@ jobs:
183173 needs : [pack, reproducibility]
184174 runs-on : ${{ matrix.os }}
185175 timeout-minutes : 15
176+ env :
177+ PYLON_RELEASE_MODE : preview
186178 permissions :
187179 actions : read
188180 contents : read
@@ -191,7 +183,7 @@ jobs:
191183 matrix :
192184 os : [ubuntu-24.04, macos-15]
193185 steps :
194- - name : Checkout exact pushed source
186+ - name : Checkout exact source
195187 uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
196188 with :
197189 ref : ${{ github.sha }}
@@ -203,9 +195,6 @@ jobs:
203195 with :
204196 node-version : ${{ env.PYLON_RELEASE_NODE }}
205197
206- - name : Install pinned npm
207- run : npm install --global "npm@${{ env.PYLON_RELEASE_NPM }}"
208-
209198 - name : Verify workflow artifact provenance
210199 uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
211200 with :
@@ -235,11 +224,22 @@ jobs:
235224 name : pylon-preview-pack-a
236225 path : .npm/pylon-release/artifacts
237226
238- - name : Verify and install the exact preview bytes
227+ - name : Run isolated artifact smoke
228+ shell : /usr/bin/bash --noprofile --norc -euo pipefail {0}
239229 run : |
240- npm run release:pylon:verify-preview
241- node -e "require('node:fs').unlinkSync('.npm/pylon-release/artifacts/pylon-preview-channel-v1.json')"
242- npm run release:pylon:smoke
230+ node_path="$(node -e 'process.stdout.write(require("node:fs").realpathSync.native(process.execPath))')"
231+ /usr/bin/env -i \
232+ "HOME=/tmp" \
233+ "PATH=${node_path%/*}:/usr/bin:/bin" \
234+ "$node_path" "$GITHUB_WORKSPACE/scripts/run-pylon-release-sandbox.mjs" \
235+ --task smoke \
236+ --mode "$PYLON_RELEASE_MODE" \
237+ --host-os "${{ runner.os }}" \
238+ --workspace "$GITHUB_WORKSPACE" \
239+ --artifact-dir "$GITHUB_WORKSPACE/.npm/pylon-release/artifacts" \
240+ --run-id "${{ github.run_id }}" \
241+ --run-number "${{ github.run_number }}" \
242+ --publication-policy-revision 3
243243
244244 stage-draft :
245245 name : Stage exact preview draft
@@ -281,7 +281,7 @@ jobs:
281281 release.source?.commit !== context.sha || release.source?.tree !== preview.build?.source?.tree ||
282282 release.build?.id !== tag || preview.build?.tag !== tag ||
283283 preview.build?.releaseManifest?.sha256 !== crypto.createHash("sha256").update(releaseBytes).digest("hex") ||
284- preview.publicationPolicyRevision !== 2 || preview.sequenceEpoch !== 1 ||
284+ preview.publicationPolicyRevision !== 3 || preview.sequenceEpoch !== 1 ||
285285 preview.sequence !== Number(process.env.GITHUB_RUN_NUMBER) || preview.workflowRunId !== process.env.GITHUB_RUN_ID
286286 ) throw new Error("Preview tag plan is not bound to the exact source and workflow sequence.");
287287 core.setOutput("tag", tag);
@@ -469,7 +469,7 @@ jobs:
469469 if (
470470 release.source?.commit !== context.sha || release.source?.tree !== preview.build?.source?.tree ||
471471 release.build?.id !== tag || preview.build?.tag !== tag || preview.build?.releaseManifest?.sha256 !== sha256(releaseBytes) ||
472- preview.publicationPolicyRevision !== 2 || preview.sequenceEpoch !== 1 ||
472+ preview.publicationPolicyRevision !== 3 || preview.sequenceEpoch !== 1 ||
473473 preview.sequence !== Number(process.env.GITHUB_RUN_NUMBER) || preview.workflowRunId !== process.env.GITHUB_RUN_ID
474474 ) throw new Error("Preview draft manifests do not bind the exact source and workflow sequence.");
475475 const expectedNames = [...release.assets.map((asset) => asset.file), "pylon-prime-agent-release-v1.json", "pylon-preview-channel-v1.json"].sort();
@@ -795,7 +795,7 @@ jobs:
795795 previewManifest.build.source.commit !== sourceSha ||
796796 previewManifest.build.source.tree !== releaseManifest.source.tree ||
797797 previewManifest.build.releaseManifest.sha256 !== sha256(releaseBytes) ||
798- previewManifest.publicationPolicyRevision !== 2 || previewManifest.sequenceEpoch !== 1 ||
798+ previewManifest.publicationPolicyRevision !== 3 || previewManifest.sequenceEpoch !== 1 ||
799799 previewManifest.sequence !== Number(process.env.GITHUB_RUN_NUMBER) || previewManifest.workflowRunId !== process.env.GITHUB_RUN_ID
800800 ) {
801801 throw new Error("Downloaded preview metadata is not bound to this exact push and workflow sequence.");
0 commit comments