Repository navigation
91 lines (85 loc) · 3.08 KB
/
Copy pathrelease.yml
File metadata and controls
91 lines (85 loc) · 3.08 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
name: Stage npm release
on:
workflow_dispatch:
inputs:
version:
description: Committed @vlkoss/oxc version to stage
required: true
type: string
permissions:
contents: read
concurrency:
group: npm-staging
cancel-in-progress: false
env:
RELEASE_VERSION: ${{ inputs.version }}
TURBO_TELEMETRY_DISABLED: "1"
DISABLE_TELEMETRY: "1"
jobs:
validate:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803
with:
ref: ${{ github.sha }}
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38
with:
node-version: "26.13.0"
cache: pnpm
- name: Check requested version
run: |
node -e '
const assert = require("node:assert/strict");
const version = require("./packages/oxc/package.json").version;
assert.match(version, /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/);
assert.equal(version, process.env.RELEASE_VERSION);
'
- name: Install pinned npm CLI
run: npm install --global npm@12.2.2
- run: pnpm install --frozen-lockfile
- name: Check versioning is complete
run: |
git branch --force main HEAD
pnpm changeset status --output "$RUNNER_TEMP/changeset-status.json"
node -e '
const assert = require("node:assert/strict");
const fs = require("node:fs");
const plan = JSON.parse(fs.readFileSync(process.env.RUNNER_TEMP + "/changeset-status.json", "utf8"));
assert.equal(plan.releases.length, 0, "Apply pending changesets before staging.");
'
- run: pnpm check
- name: Pack and inspect release
run: |
mkdir -p "$RUNNER_TEMP/npm-package"
pnpm --filter @vlkoss/oxc pack --pack-destination "$RUNNER_TEMP/npm-package"
pnpm test:distribution "$RUNNER_TEMP/npm-package/vlkoss-oxc-$RELEASE_VERSION.tgz"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: oxc-package
path: ${{ runner.temp }}/npm-package/*.tgz
if-no-files-found: error
retention-days: 3
stage:
if: github.ref == 'refs/heads/main'
needs: validate
runs-on: ubuntu-latest
timeout-minutes: 10
environment: npm
permissions:
contents: read
id-token: write
steps:
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38
with:
node-version: "26.13.0"
- name: Install pinned npm CLI
run: npm install --global npm@12.2.2
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333
with:
name: oxc-package
path: ${{ runner.temp }}/npm-package
- name: Stage with npm trusted publishing
run: npm stage publish "$RUNNER_TEMP/npm-package/vlkoss-oxc-$RELEASE_VERSION.tgz" --access public --tag latest --ignore-scripts