-
-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (74 loc) · 2.96 KB
/
npmPublish.yml
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
84
85
86
87
88
89
90
name: Publish npm Packages
on:
push:
branches:
- main
# These currently require that the package version has been manually updated
# We could potentially automate it by creating a separate script that fetches the current version on npm and compares it the the version in the package.json. If it matches, it auto-increments the number in package.json (ie from 2.1.11 to 2.1.12). And we run this script before the publish step.
# Simpler solution is to use npm version command that can be used to increment the version number (npm version patch, npm version minor, npm version major) where format is major.minor.patch
# Any version incrementing should probably happen on pushes to dev so that dev and main branch stay in sync. We can simply always increment the patch version
# Think we can update github settings to ensure you merges fail if an action fails, but that means each merge updates all 3 packages
jobs:
publish-react:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Use Node.js version 20
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies for package-react
working-directory: ./package-react
run: npm ci
- name: Build package-react
working-directory: ./package-react
run: npm run build
- name: Publish package-react
working-directory: ./package-react
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish
publish-svelte:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Use Node.js version 20
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies for package-svelte
working-directory: ./package-svelte
run: npm ci
- name: Build package-svelte
working-directory: ./package-svelte
run: npm run build
- name: Publish package-svelte
working-directory: ./package-svelte
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish
publish-vue:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Use Node.js version 20
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies for package-vue
working-directory: ./package-vue
run: npm ci
- name: Build package-vue
working-directory: ./package-vue
run: npm run build
- name: Publish package-vue
working-directory: ./package-vue
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish