-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (59 loc) · 1.66 KB
/
Copy pathrelease.yml
File metadata and controls
70 lines (59 loc) · 1.66 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
name: Release
on:
push:
tags:
- v*.*.*
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
jobs:
test:
name: Publish
runs-on: ubuntu-latest
environment: Production
permissions:
contents: read
id-token: write
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Install Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: https://registry.npmjs.org/
- name: Update npm
run: npm install -g npm@latest
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Print Environment Info
run: pnpm nx report
shell: bash
- name: Build packages
run: pnpm build
- name: Determine npm dist-tag
id: dist_tag
shell: bash
run: |
# For prerelease tags like v1.0.0-beta.1, publish under the
# prerelease identifier (e.g. "beta"). Stable releases use "latest".
if [[ "${GITHUB_REF_NAME}" == *-* ]]; then
prerelease="${GITHUB_REF_NAME#*-}"
tag="${prerelease%%.*}"
else
tag="latest"
fi
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
echo "Publishing with dist-tag: ${tag}"
- name: Publish packages
run: pnpm nx release publish --tag=${{ steps.dist_tag.outputs.tag }}
shell: bash
env:
NPM_CONFIG_PROVENANCE: true