-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (68 loc) · 2.76 KB
/
Copy pathrelease.yml
File metadata and controls
72 lines (68 loc) · 2.76 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
name: Publish package
on:
workflow_dispatch:
inputs:
channel:
description: 'beta for prereleases; latest for stable releases'
required: true
type: choice
options:
- beta
- latest
concurrency:
group: npm-package-release
cancel-in-progress: false
permissions:
checks: read
contents: write
id-token: write
jobs:
publish:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: npm-publish
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ssh-key: ${{ secrets.RELEASE_TAG_SSH_KEY }}
- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org
cache: npm
- name: Recheck the frozen release candidate before dependency installation
run: node scripts/check-release-candidate.mjs ${{ inputs.channel }}
- name: Verify the exact main commit passed protected CI
env:
GITHUB_TOKEN: ${{ github.token }}
run: node scripts/verify-required-checks.mjs
- name: Use an OIDC-capable npm CLI
run: npm install --global npm@11.19.0
- run: npm ci
- name: Enforce release documents and clean-consumer installation
run: node scripts/release-preflight.mjs ${{ inputs.channel }}
- name: Create the immutable matching release tag
run: |
VERSION="$(node --print "require('./packages/astro-visual-editor/package.json').version")"
test -z "$(git tag --list "v$VERSION")"
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git tag --annotate "v$VERSION" --message "Release v$VERSION"
git push origin "v$VERSION"
- name: Publish with provenance
run: npm publish --workspace @opacedev/astro-visual-editor --tag ${{ inputs.channel }}
- name: Verify the exact published registry package
run: node scripts/verify-published-release.mjs "$(node --print "require('./packages/astro-visual-editor/package.json').version")" ${{ inputs.channel }}
- name: Record the completion evidence
run: |
VERSION="$(node --print "require('./packages/astro-visual-editor/package.json').version")"
{
echo "## Published $VERSION"
echo
echo "- Main commit: \`$GITHUB_SHA\`"
echo "- npm: https://www.npmjs.com/package/@opacedev/astro-visual-editor/v/$VERSION"
echo "- Release workflow: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
echo "- Registry consumer: passed"
echo "- Astro directory import: automatic external follow-up"
} >> "$GITHUB_STEP_SUMMARY"