-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (58 loc) · 1.7 KB
/
publish-release.yml
File metadata and controls
65 lines (58 loc) · 1.7 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
name: Release and Publish
on:
push:
branches:
- main
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
outputs:
released: ${{ steps.release.outputs.released }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Automatic GitHub Release
uses: justincy/github-action-npm-release@2.0.2
with:
path: ${{ github.workspace }}/packages/react-dialog-async
id: release
- name: Print release output
if: ${{ steps.release.outputs.released == 'true' }}
run: echo Release ID ${{ steps.release.outputs.release_id }}
publish-package:
name: Publish to NPM
needs: [create-release]
if: needs.create-release.outputs.released == 'true'
runs-on: ubuntu-latest
steps:
- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
version: 9.15.4
- name: Checkout project
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup node
uses: actions/setup-node@v4
with:
cache: 'pnpm'
node-version: 22
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: pnpm i
- name: Build project
working-directory: packages/react-dialog-async
run: pnpm build
- name: Run tests
working-directory: packages/react-dialog-async
run: pnpm test
- name: Publish the dist folder to npm
working-directory: packages/react-dialog-async
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}