-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (64 loc) · 2.06 KB
/
release.yml
File metadata and controls
82 lines (64 loc) · 2.06 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
id-token: write
jobs:
publish:
name: publish
runs-on: ubuntu-latest
environment:
name: Production
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup monorepo
uses: ./.github/actions/setup-monorepo
- name: Write CI env files
uses: ./.github/actions/write-ci-env
- name: Lint workspace
run: pnpm lint
- name: Typecheck workspace
run: pnpm typecheck
- name: Run unit and integration tests
run: pnpm test
- name: Build workspace
run: pnpm build
- name: Build publishable package
run: pnpm release:build-package
- name: Verify scaffold package
run: node scripts/verify-create-package.mjs
- name: Write release notes
run: node scripts/write-release-notes.mjs "${GITHUB_REF_NAME}" "dist/release-notes.md"
- name: Configure npm authentication
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org
- name: Verify npm token
if: env.NPM_TOKEN != ''
env:
NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }}
run: npm whoami --registry=https://registry.npmjs.org/
- name: Use npm trusted publishing
if: env.NPM_TOKEN == ''
run: echo "No NPM_TOKEN configured. Relying on npm trusted publishing via GitHub OIDC."
- name: Publish to npm with token
if: env.NPM_TOKEN != ''
run: npm publish ./dist/create-acme-platform --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }}
- name: Publish to npm with trusted publishing
if: env.NPM_TOKEN == ''
run: npm publish ./dist/create-acme-platform --access public
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
body_path: dist/release-notes.md