-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (65 loc) · 2.04 KB
/
Copy pathrelease.yml
File metadata and controls
83 lines (65 loc) · 2.04 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
name: Release @angular-bootstrap/ngbootstrap
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: read
id-token: write
jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
environment: npm-production
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22.x
- name: Use current npm for trusted publishing
run: npm install -g npm@latest
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
- name: Run tests
run: pnpm test:ci
- name: Build library
run: pnpm build
- name: Validate package metadata
run: pnpm release:verify
- name: Validate release tag
run: |
set -euo pipefail
VERSION="$(node -p "require('./package.json').version")"
TAG="${GITHUB_REF_NAME}"
if [ "$TAG" != "v$VERSION" ]; then
echo "Release tag $TAG must match package version v$VERSION."
exit 1
fi
- name: Verify version is unpublished
run: |
set -euo pipefail
VERSION="$(node -p "require('./package.json').version")"
if npm view "@angular-bootstrap/ngbootstrap@$VERSION" version >/dev/null 2>&1; then
echo "@angular-bootstrap/ngbootstrap@$VERSION is already published."
exit 1
fi
- name: Inspect npm package contents
run: pnpm pack:dry-run
- name: Audit production dependencies
run: pnpm security:audit
- name: Ensure tokenless publishing
run: |
set -euo pipefail
if [ -n "${NODE_AUTH_TOKEN:-}" ]; then
echo "NODE_AUTH_TOKEN must not be set for npm trusted publishing."
exit 1
fi
npm --version
- name: Publish to npm
run: npm publish ./dist/ngbootstrap --access public --provenance