-
Notifications
You must be signed in to change notification settings - Fork 439
50 lines (44 loc) · 1.47 KB
/
release.yml
File metadata and controls
50 lines (44 loc) · 1.47 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
name: Release on chore commit
on:
push:
branches:
- master
- 'spring*'
- 'summer*'
- 'winter*'
pull_request:
branches:
- master
- 'spring*'
- 'summer*'
- 'winter*'
jobs:
release:
# TODO: remove PR bypass after testing
if: ${{ github.event_name == 'pull_request' || (contains(toJSON(github.event.commits), 'chore') && contains(toJSON(github.event.commits), 'release')) }}
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Publish with Nx Release
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
TAG=$([ "$GITHUB_REF_NAME" = "master" ] && echo latest || echo release)
yarn nx release publish --dry-run --yes --registry https://registry.npmjs.org --tag "$TAG"