48
48
grep -q '"lockfileVersion": 3,' ./package-lock.json
49
49
50
50
npm ci CYPRESS_INSTALL_BINARY=0 --ignore-scripts
51
+
51
52
- name : ⏭️ Modifications when prerelease
52
53
if : github.event.release.prerelease
53
54
run : echo "NPM_PUBLISH_TAG=next" >> $GITHUB_ENV
@@ -81,10 +82,68 @@ jobs:
81
82
# Use 'latest' tag if $NPM_PUBLISH_TAG is not set:
82
83
npm publish --access public --tag ${NPM_PUBLISH_TAG:-latest}
83
84
85
+ smoke_tests :
86
+ # Run on all events defined above, except pushes which are not to master
87
+ if : github.event_name != 'push' || github.ref == 'refs/heads/master'
88
+ runs-on : ubuntu-latest
89
+ name : " Storybook Smoke Tests"
90
+
91
+ container :
92
+ image : mcr.microsoft.com/playwright:v1.39.0-jammy
93
+ options : --user 1001
94
+
95
+ steps :
96
+ - name : 📖 Checkout commit locally
97
+ uses : actions/checkout@v3
98
+
99
+ - name : 📦 Install build dependencies
100
+ run : |
101
+ npm ci CYPRESS_INSTALL_BINARY=0 --ignore-scripts
102
+
103
+ - name : 🏗️ Build packages
104
+ run : |
105
+ npx nx run-many -t build
106
+
107
+ - name : 📚 Build Storybook
108
+ run : npm run build-storybook
109
+
110
+ - name : Run smoke tests
111
+
112
+ env :
113
+ PORT : 8080
114
+ HOST : 127.0.0.1
115
+
116
+ run : |
117
+ npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
118
+ "npx http-server storybook-static --port $PORT -a $HOST" \
119
+ "npx wait-on http://$HOST:$PORT/ && npm run storybook:test -- --ci --url http://$HOST:$PORT/"
120
+
121
+ storybook :
122
+ # Always validate Storybook build. Deploy it only on pushes to master.
123
+ if : github.event_name != 'push' || github.ref == 'refs/heads/master'
124
+ runs-on : ubuntu-latest
125
+ name : " 📚 Build and conditionally deploy Storybook"
126
+ steps :
127
+ - name : 📖 Checkout commit locally
128
+ uses : actions/checkout@v3
129
+
130
+ - name : Setup Node.js
131
+ uses : actions/setup-node@v3
132
+ with :
133
+ node-version : 18
134
+
135
+ - name : 📦 Install build dependencies
136
+ run : |
137
+ npm ci CYPRESS_INSTALL_BINARY=0 --ignore-scripts
138
+
139
+ - name : 🏗️ Build packages
140
+ run : |
141
+ npx nx run-many -t build
142
+
84
143
- name : 📚 Build Storybook
85
144
run : npm run build-storybook
86
145
87
- - name : 📚 Update Storybook
146
+ - name : 📚 Update deployed Storybook
88
147
if : github.event_name == 'push' && github.ref == 'refs/heads/master'
89
148
run : |
90
149
rm -rf ../../storybook-static
@@ -108,20 +167,21 @@ jobs:
108
167
git push "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" gh-pages
109
168
fi
110
169
111
- smoke_tests :
112
- # Run on all events defined above, except pushes which are not to master
170
+ release_dry_run :
171
+ # Dry-run semantic release on PR and pushes to master
113
172
if : github.event_name != 'push' || github.ref == 'refs/heads/master'
114
173
runs-on : ubuntu-latest
115
- name : " Storybook Smoke Tests"
116
-
117
- container :
118
- image : mcr.microsoft.com/playwright:v1.39.0-jammy
119
- options : --user 1001
174
+ name : " 🔼 Dry-run semantic release"
120
175
121
176
steps :
122
177
- name : 📖 Checkout commit locally
123
178
uses : actions/checkout@v3
124
179
180
+ - name : Setup Node.js
181
+ uses : actions/setup-node@v3
182
+ with :
183
+ node-version : 18
184
+
125
185
- name : 📦 Install build dependencies
126
186
run : |
127
187
npm ci CYPRESS_INSTALL_BINARY=0 --ignore-scripts
@@ -130,16 +190,14 @@ jobs:
130
190
run : |
131
191
npx nx run-many -t build
132
192
133
- - name : 📚 Build Storybook
134
- run : npm run build-storybook
193
+ - name : 🔼 Dry-run semantic release
194
+ working-directory : ./typescript
195
+ run : npx nx run-many --target="semantic-release:dry-run" --parallel=false
196
+ env :
197
+ GITHUB_TOKEN : ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
198
+ GH_TOKEN : ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
199
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
200
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
135
201
136
- - name : Run smoke tests
137
202
138
- env :
139
- PORT : 8080
140
- HOST : 127.0.0.1
141
203
142
- run : |
143
- npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
144
- "npx http-server storybook-static --port $PORT -a $HOST" \
145
- "npx wait-on http://$HOST:$PORT/ && npm run storybook:test -- --ci --url http://$HOST:$PORT/"
0 commit comments