Repository navigation
118 lines (114 loc) · 5.01 KB
/
Copy pathnpm-package-bootstrap.yml
File metadata and controls
118 lines (114 loc) · 5.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Bootstrap six npm package names
on:
workflow_dispatch:
inputs:
source_ci_run_id:
description: Completed CI release_candidate run on this HEAD (omit for C5 latest cleanup)
required: false
type: string
source_ci_attempt:
description: Latest successful CI attempt (omit for C5 latest cleanup)
required: false
type: string
publish:
description: Publish only the six inactive bootstrap versions (default is dry run)
type: boolean
default: false
confirm:
description: Exact confirmation for the selected reviewed write
type: string
default: ""
cleanup_failed_c5_latest:
description: Remove only the unintended C5 @master/css-next latest tag
type: boolean
default: false
permissions:
contents: read
concurrency:
group: master-css-npm-package-bootstrap
cancel-in-progress: false
jobs:
bootstrap:
if: ${{ github.repository == 'master-co/css' && github.ref_type == 'branch' && (github.ref_name == 'main' || github.ref_name == 'rc') && !inputs.cleanup_failed_c5_latest }}
runs-on: ubuntu-24.04
timeout-minutes: 90
permissions:
contents: read
actions: read
id-token: write
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.sha }}
fetch-depth: 0
persist-credentials: false
- uses: ./.github/actions/setup-bun
with:
turbo-cache: "false"
- name: Test the isolated bootstrap guards
run: node --test scripts/npm-package-bootstrap.test.mjs
- name: Plan against completed exact-source CI and absent public names
run: node scripts/npm-package-bootstrap.mjs plan --run-id "$SOURCE_CI_RUN_ID" --attempt "$SOURCE_CI_ATTEMPT" --output bootstrap-artifacts
env:
SOURCE_CI_RUN_ID: ${{ inputs.source_ci_run_id }}
SOURCE_CI_ATTEMPT: ${{ inputs.source_ci_attempt }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Verify native ZIPs and perform standard build and release preparation
run: node scripts/npm-package-bootstrap.mjs prepare --plan bootstrap-artifacts/plan.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install the pinned provenance-capable npm CLI
run: npm install --global npm@11.21.0
- name: Dry-run or explicitly publish the reviewed six archives
run: node scripts/npm-package-bootstrap.mjs publish --plan bootstrap-artifacts/plan.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BOOTSTRAP_PUBLISH: ${{ inputs.publish }}
BOOTSTRAP_CONFIRM: ${{ inputs.confirm }}
NPM_PACKAGE_BOOTSTRAP_TOKEN: ${{ inputs.publish && secrets.NPM_PACKAGE_BOOTSTRAP_TOKEN || '' }}
- name: Retain original archives and source/integrity/provenance receipts even after failure
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: npm-package-bootstrap-${{ github.sha }}-${{ github.run_attempt }}
path: bootstrap-artifacts/
if-no-files-found: warn
retention-days: 90
cleanup:
name: Remove unintended latest from the archived C5 bootstrap version
if: ${{ github.repository == 'master-co/css' && github.ref_type == 'branch' && (github.ref_name == 'main' || github.ref_name == 'rc') && inputs.cleanup_failed_c5_latest }}
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: read
actions: read
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.sha }}
persist-credentials: false
- uses: ./.github/actions/setup-bun
with:
turbo-cache: "false"
- name: Test the isolated bootstrap and cleanup guards
run: node --test scripts/npm-package-bootstrap.test.mjs
- name: Install the pinned npm CLI and provenance verifier
run: npm install --global npm@11.21.0
- name: Verify original provenance and remove only the unintended C5 latest tag
run: node scripts/npm-package-bootstrap.mjs cleanup-failed-c5-latest --output cleanup-artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BOOTSTRAP_SOURCE_CI_RUN_ID: ${{ inputs.source_ci_run_id }}
BOOTSTRAP_SOURCE_CI_ATTEMPT: ${{ inputs.source_ci_attempt }}
BOOTSTRAP_CLEANUP: ${{ inputs.cleanup_failed_c5_latest }}
BOOTSTRAP_PUBLISH: ${{ inputs.publish }}
BOOTSTRAP_CONFIRM: ${{ inputs.confirm }}
NPM_PACKAGE_BOOTSTRAP_TOKEN: ${{ !inputs.publish && inputs.confirm == 'REMOVE C5 BOOTSTRAP LATEST' && !inputs.source_ci_run_id && !inputs.source_ci_attempt && secrets.NPM_PACKAGE_BOOTSTRAP_TOKEN || '' }}
- name: Retain verified evidence and attempted cleanup receipt
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: npm-package-bootstrap-cleanup-${{ github.sha }}-${{ github.run_attempt }}
path: cleanup-artifacts/
if-no-files-found: warn
retention-days: 90