Skip to content

Commit 1eb08d1

Browse files
committed
ci: make edge releases on commit basis
1 parent 1700aa1 commit 1eb08d1

File tree

1 file changed

+68
-69
lines changed

1 file changed

+68
-69
lines changed

.github/workflows/test.yml

Lines changed: 68 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,9 @@ concurrency:
1919

2020
jobs:
2121
setup:
22-
runs-on: ${{ matrix.os }}
22+
runs-on: ubuntu-latest
2323
if: github.event_name == 'push' || !((github.base_ref == '2.x') && github.head_ref == 'dev')
2424

25-
strategy:
26-
matrix:
27-
# os: [ubuntu-latest, macos-latest, windows-latest]
28-
os: [ubuntu-latest]
29-
3025
steps:
3126
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
3227
with:
@@ -51,14 +46,10 @@ jobs:
5146
packages/*/node_modules
5247
distributions/*/node_modules
5348
packages/*/dist
54-
key: ${{ matrix.os }}-node-v18-nuxt-${{ github.sha }}
49+
key: ubuntu-latest-node-v18-nuxt-${{ github.sha }}
5550

5651
lint:
57-
runs-on: ${{ matrix.os }}
58-
59-
strategy:
60-
matrix:
61-
os: [ubuntu-latest]
52+
runs-on: ubuntu-latest
6253

6354
steps:
6455
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
@@ -76,18 +67,14 @@ jobs:
7667
packages/*/node_modules
7768
distributions/*/node_modules
7869
packages/*/dist
79-
key: ${{ matrix.os }}-node-v18-nuxt-${{ github.sha }}
70+
key: ubuntu-latest-node-v18-nuxt-${{ github.sha }}
8071

8172
- name: lint
8273
run: yarn test:lint
8374
needs: setup
8475

8576
typecheck:
86-
runs-on: ${{ matrix.os }}
87-
88-
strategy:
89-
matrix:
90-
os: [ubuntu-latest]
77+
runs-on: ubuntu-latest
9178

9279
steps:
9380
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
@@ -105,7 +92,7 @@ jobs:
10592
packages/*/node_modules
10693
distributions/*/node_modules
10794
packages/*/dist
108-
key: ${{ matrix.os }}-node-v18-nuxt-${{ github.sha }}
95+
key: ubuntu-latest-node-v18-nuxt-${{ github.sha }}
10996

11097
- name: test types
11198
run: yarn test:types
@@ -115,11 +102,7 @@ jobs:
115102
needs: setup
116103

117104
audit:
118-
runs-on: ${{ matrix.os }}
119-
120-
strategy:
121-
matrix:
122-
os: [ubuntu-latest]
105+
runs-on: ubuntu-latest
123106

124107
steps:
125108
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
@@ -137,19 +120,14 @@ jobs:
137120
packages/*/node_modules
138121
distributions/*/node_modules
139122
packages/*/dist
140-
key: ${{ matrix.os }}-node-v18-nuxt-${{ github.sha }}
123+
key: ubuntu-latest-node-v18-nuxt-${{ github.sha }}
141124

142125
- name: audit
143126
run: yarn run audit
144127
needs: setup
145128

146129
test-unit:
147-
runs-on: ${{ matrix.os }}
148-
149-
strategy:
150-
matrix:
151-
# os: [ubuntu-latest, macos-latest, windows-latest]
152-
os: [ubuntu-latest]
130+
runs-on: ubuntu-latest
153131

154132
steps:
155133
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
@@ -167,7 +145,7 @@ jobs:
167145
packages/*/node_modules
168146
distributions/*/node_modules
169147
packages/*/dist
170-
key: ${{ matrix.os }}-node-v18-nuxt-${{ github.sha }}
148+
key: ubuntu-latest-node-v18-nuxt-${{ github.sha }}
171149

172150
- name: test unit
173151
run: yarn test:unit --coverage
@@ -180,12 +158,7 @@ jobs:
180158
needs: setup
181159

182160
build:
183-
runs-on: ${{ matrix.os }}
184-
185-
strategy:
186-
matrix:
187-
# os: [ubuntu-latest, macos-latest, windows-latest]
188-
os: [ubuntu-latest]
161+
runs-on: ubuntu-latest
189162

190163
env:
191164
NODE_OPTIONS: "--max_old_space_size=4096"
@@ -206,24 +179,20 @@ jobs:
206179
packages/*/node_modules
207180
distributions/*/node_modules
208181
packages/*/dist
209-
key: ${{ matrix.os }}-node-v18-nuxt-${{ github.sha }}
182+
key: ubuntu-latest-node-v18-nuxt-${{ github.sha }}
210183

211184
- name: build
212185
run: yarn test:fixtures -i
213186

214187
- name: Save fixtures
215188
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
216189
with:
217-
name: fixtures-${{ matrix.os }}-node-v18
190+
name: fixtures-ubuntu-latest-node-v18
218191
path: test/fixtures
219192
needs: setup
220193

221194
lint-app:
222-
runs-on: ${{ matrix.os }}
223-
224-
strategy:
225-
matrix:
226-
os: [ubuntu-latest]
195+
runs-on: ubuntu-latest
227196

228197
steps:
229198
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
@@ -241,25 +210,20 @@ jobs:
241210
packages/*/node_modules
242211
distributions/*/node_modules
243212
packages/*/dist
244-
key: ${{ matrix.os }}-node-v18-nuxt-${{ github.sha }}
213+
key: ubuntu-latest-node-v18-nuxt-${{ github.sha }}
245214

246215
- name: restore fixtures
247216
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
248217
with:
249-
name: fixtures-${{ matrix.os }}-node-v18
218+
name: fixtures-ubuntu-latest-node-v18
250219
path: test/fixtures
251220

252221
- name: lint app
253222
run: yarn lint:app
254223
needs: build
255224

256225
test-dev:
257-
runs-on: ${{ matrix.os }}
258-
259-
strategy:
260-
matrix:
261-
# os: [ubuntu-latest, macos-latest, windows-latest]
262-
os: [ubuntu-latest]
226+
runs-on: ubuntu-latest
263227

264228
steps:
265229
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
@@ -277,25 +241,20 @@ jobs:
277241
packages/*/node_modules
278242
distributions/*/node_modules
279243
packages/*/dist
280-
key: ${{ matrix.os }}-node-v18-nuxt-${{ github.sha }}
244+
key: ubuntu-latest-node-v18-nuxt-${{ github.sha }}
281245

282246
- name: restore fixtures
283247
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
284248
with:
285-
name: fixtures-${{ matrix.os }}-node-v18
249+
name: fixtures-ubuntu-latest-node-v18
286250
path: test/fixtures
287251

288252
- name: test dev
289253
run: yarn test:dev
290254
needs: build
291255

292256
test-e2e:
293-
runs-on: ${{ matrix.os }}
294-
295-
strategy:
296-
matrix:
297-
# os: [ubuntu-latest, macos-latest, windows-latest]
298-
os: [ubuntu-latest]
257+
runs-on: ubuntu-latest
299258

300259
steps:
301260
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
@@ -313,26 +272,24 @@ jobs:
313272
packages/*/node_modules
314273
distributions/*/node_modules
315274
packages/*/dist
316-
key: ${{ matrix.os }}-node-v18-nuxt-${{ github.sha }}
275+
key: ubuntu-latest-node-v18-nuxt-${{ github.sha }}
317276

318277
- name: restore fixtures
319278
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
320279
with:
321-
name: fixtures-${{ matrix.os }}-node-v18
280+
name: fixtures-ubuntu-latest-node-v18
322281
path: test/fixtures
323282

324283
- name: test e2e
325284
run: yarn test:e2e
326285
needs: build
327286

328287
release-commit:
288+
if: github.event_name == 'push' && contains(github.event.head_commit.message, '[release]')
289+
needs: [lint-app, test-dev, test-unit, test-e2e]
290+
runs-on: ubuntu-latest
329291
permissions:
330292
id-token: write
331-
if: github.event_name == 'push' && contains(github.event.head_commit.message, '[release]')
332-
runs-on: ${{ matrix.os }}
333-
strategy:
334-
matrix:
335-
os: [ubuntu-latest]
336293

337294
steps:
338295
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
@@ -351,7 +308,7 @@ jobs:
351308
packages/*/node_modules
352309
distributions/*/node_modules
353310
packages/*/dist
354-
key: ${{ matrix.os }}-node-v18-nuxt-${{ github.sha }}
311+
key: ubuntu-latest-node-v18-nuxt-${{ github.sha }}
355312

356313
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
357314
with:
@@ -372,4 +329,46 @@ jobs:
372329
ref: ${{ github.ref }}
373330
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
374331
NPM_CONFIG_PROVENANCE: true
332+
333+
release-nightly:
334+
if: github.repository_owner == 'nuxt' && github.event_name == 'push'
375335
needs: [lint-app, test-dev, test-unit, test-e2e]
336+
runs-on: ubuntu-latest
337+
permissions:
338+
id-token: write
339+
steps:
340+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
341+
with:
342+
ref: "refs/heads/dev"
343+
fetch-depth: 0 # All history
344+
345+
- name: fetch tags
346+
run: git fetch --depth=1 origin "+refs/tags/*:refs/tags/*"
347+
348+
- name: restore workspace cache
349+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
350+
with:
351+
path: |
352+
node_modules
353+
packages/*/node_modules
354+
distributions/*/node_modules
355+
packages/*/dist
356+
key: ubuntu-latest-node-v18-nuxt-${{ github.sha }}
357+
358+
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
359+
with:
360+
node-version: 18
361+
cache: "yarn"
362+
registry-url: "https://registry.npmjs.org"
363+
364+
- name: bump version
365+
run: yarn lerna version --yes --no-changelog --no-git-tag-version --no-push --force-publish "*" --loglevel verbose
366+
367+
- name: build
368+
run: PACKAGE_SUFFIX=edge yarn build
369+
370+
- name: publish
371+
run: ./scripts/workspace-run npm publish -q
372+
env:
373+
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
374+
NPM_CONFIG_PROVENANCE: true

0 commit comments

Comments
 (0)