-
-
Notifications
You must be signed in to change notification settings - Fork 98
60 lines (54 loc) · 2.23 KB
/
Copy pathrelease.yml
File metadata and controls
60 lines (54 loc) · 2.23 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
name: Release
on:
workflow_dispatch:
inputs:
first-release:
description: 'First release using the {projectName}@{version} tag scheme (no prior tags to diff against)'
type: boolean
default: false
dry-run:
description: 'Compute versions/changelogs without writing, tagging, or publishing'
type: boolean
default: false
concurrency:
group: release
cancel-in-progress: false
permissions:
contents: write # push version-bump commit + tags, create GitHub releases
id-token: write # npm provenance / OIDC trusted publishing
jobs:
release:
name: nx release (alpha)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history is required for conventional-commit version analysis
- uses: jdx/mise-action@v4
- name: Configure npm registry
run: >-
printf '%s\n'
'registry=https://registry.npmjs.org/'
'//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}'
>> ~/.npmrc
- run: pnpm install --frozen-lockfile
# 1. bump versions, write changelogs, tag, create GitHub releases — but do not publish yet
- name: Version + changelog + tag
run: >-
pnpm exec nx release
${{ inputs.first-release && '--first-release' || '' }}
${{ inputs.dry-run && '--dry-run' || '' }}
--skip-publish --yes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 2. build the dist artifacts with the freshly-bumped versions
- name: Build packages
if: ${{ !inputs.dry-run }}
run: pnpm run package
# 3. publish the built dist to npm under the alpha dist-tag with provenance
- name: Publish (alpha, provenance)
if: ${{ !inputs.dry-run }}
run: pnpm exec nx release publish --tag=alpha
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true