@@ -26,19 +26,19 @@ jobs:
26
26
runs-on : ubuntu-latest
27
27
28
28
steps :
29
- - uses : actions/checkout@v3
30
- - uses : actions/setup-node@v3
29
+ - uses : actions/checkout@v4
30
+ - uses : actions/setup-node@v4
31
31
with :
32
32
node-version-file : ' .nvmrc'
33
- cache : yarn
33
+ cache : npm
34
34
35
35
- name : Build Storybook docs
36
36
run : |
37
- yarn install
38
- yarn build-storybook --quiet
37
+ npm ci
38
+ npm run build-storybook --quiet
39
39
40
40
- name : Upload artifact
41
- uses : actions/upload-pages-artifact@v1
41
+ uses : actions/upload-pages-artifact@v4
42
42
with :
43
43
path : ./storybook-static
44
44
@@ -47,59 +47,42 @@ jobs:
47
47
runs-on : ubuntu-latest
48
48
49
49
steps :
50
- - uses : actions/checkout@v3
51
- - uses : actions/setup-node@v3
50
+ - uses : actions/checkout@v4
51
+ - uses : actions/setup-node@v4
52
52
with :
53
53
node-version-file : ' .nvmrc'
54
- cache : yarn
54
+ cache : npm
55
55
56
56
- name : Install dependencies
57
- run : yarn install
57
+ run : npm ci
58
58
59
59
- name : Build library
60
60
run : |
61
- yarn build
61
+ npm run build
62
62
63
63
- name : Store build artifact
64
- uses : actions/upload-artifact@v3
64
+ uses : actions/upload-artifact@v4
65
65
with :
66
66
name : build
67
- path : dist /
67
+ path : lib /
68
68
retention-days : 1
69
69
70
70
prettier :
71
71
name : prettier (code formatting)
72
72
runs-on : ubuntu-latest
73
73
74
74
steps :
75
- - uses : actions/checkout@v3
76
- - uses : actions/setup-node@v3
75
+ - uses : actions/checkout@v4
76
+ - uses : actions/setup-node@v4
77
77
with :
78
78
node-version-file : ' .nvmrc'
79
- cache : yarn
79
+ cache : npm
80
80
81
81
- name : Install dependencies
82
- run : yarn install
82
+ run : npm ci
83
83
84
84
- name : Run prettier linter
85
- run : yarn checkformat
86
-
87
- eslint :
88
- name : eslint (code formatting)
89
- runs-on : ubuntu-latest
90
-
91
- steps :
92
- - uses : actions/checkout@v3
93
- - uses : actions/setup-node@v3
94
- with :
95
- node-version-file : ' .nvmrc'
96
- cache : yarn
97
-
98
- - name : Install dependencies
99
- run : yarn install
100
-
101
- - name : Run ESLint
102
- run : yarn test:lint
85
+ run : npm run checkformat
103
86
104
87
tests :
105
88
name : Run Storybook tests
@@ -108,22 +91,22 @@ jobs:
108
91
- storybook
109
92
110
93
steps :
111
- - uses : actions/checkout@v3
112
- - uses : actions/setup-node@v3
94
+ - uses : actions/checkout@v4
95
+ - uses : actions/setup-node@v4
113
96
with :
114
97
node-version-file : ' .nvmrc'
115
- cache : yarn
98
+ cache : npm
116
99
117
100
- name : Install dependencies
118
- run : yarn install
101
+ run : npm install
119
102
120
103
# Reference: https://storybook.js.org/docs/6.5/react/writing-tests/test-runner#run-against-non-deployed-storybooks
121
104
- name : Set up test environment
122
105
run : |
123
106
npx playwright install --with-deps
124
107
125
108
- name : Download storybook artifact
126
- uses : actions/download-artifact@v3
109
+ uses : actions/download-artifact@v4
127
110
with :
128
111
name : github-pages
129
112
path : storybook-static
@@ -133,15 +116,13 @@ jobs:
133
116
cd storybook-static/ && tar -xvf artifact.tar && cd ..
134
117
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
135
118
"npx http-server storybook-static --port 6006 --quiet" \
136
- "npx wait-on -l http://127.0.0.1:6006 && yarn test:storybook"
119
+ "npx wait-on -l http://127.0.0.1:6006 && npm run test:storybook"
137
120
138
121
deploy :
139
122
runs-on : ubuntu-latest
140
123
needs :
141
124
- storybook
142
125
- prettier
143
- - eslint
144
- - tests
145
126
# do not run in forks & only publish main branch
146
127
if : github.ref_name == 'main' && github.repository_owner == 'open-formulieren'
147
128
@@ -158,37 +139,35 @@ jobs:
158
139
steps :
159
140
- name : Setup Pages
160
141
id : pages
161
- uses : actions/configure-pages@v3
142
+ uses : actions/configure-pages@v4
162
143
- name : Deploy to GitHub Pages
163
144
id : deployment
164
- uses : actions/deploy-pages@v1
145
+ uses : actions/deploy-pages@v4
165
146
166
147
publish :
167
148
name : Publish the NPM package
168
149
runs-on : ubuntu-latest
169
150
needs :
170
151
- build-package
171
152
- prettier
172
- - eslint
173
- - tests
174
153
175
154
# do not publish in forks or non-tag pushes
176
155
if : startsWith(github.ref, 'refs/tags/') && github.repository_owner == 'open-formulieren'
177
156
178
157
steps :
179
- - uses : actions/checkout@v3
180
- - uses : actions/setup-node@v3
158
+ - uses : actions/checkout@v4
159
+ - uses : actions/setup-node@v4
181
160
with :
182
161
node-version-file : ' .nvmrc'
183
- cache : yarn
162
+ cache : npm
184
163
registry-url : ' https://registry.npmjs.org'
185
164
scope : ' @open-formulieren'
186
165
187
166
- name : Install dependencies
188
- run : yarn install
167
+ run : npm install
189
168
190
169
- name : Download build artifact
191
- uses : actions/download-artifact@v3
170
+ uses : actions/download-artifact@v4
192
171
with :
193
172
name : build
194
173
path : dist/
@@ -198,6 +177,6 @@ jobs:
198
177
# Strip git ref prefix from version
199
178
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
200
179
201
- yarn publish --access public --new-version=$VERSION
180
+ npm publish --access public --new-version=$VERSION
202
181
env :
203
182
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments