generated from chiffre-io/template-library
-
-
Notifications
You must be signed in to change notification settings - Fork 119
110 lines (105 loc) · 3.92 KB
/
ci-cd.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: CI/CD
on:
push:
pull_request:
types: [opened, reopened]
env:
FORCE_COLOR: 3 # Diplay chalk colors
jobs:
ci:
# Watch out! When changing the job name,
# update the required checks in GitHub
# branch protection settings for `next`.
name: CI (${{ matrix.next-version }}${{ matrix.base-path && ' basePath' || ''}}${{ matrix.window-history-support && ' WHS' || ''}})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Watch out! When changing the compat grid,
# update the required checks in GitHub
# branch protection settings for `next`.
base-path: [false, '/base']
window-history-support: [false]
next-version:
- '13.4'
- '13.5'
- '14.0.1'
# 14.0.2 is not compatible due to a prefetch issue
- latest
- '14.0.5-canary.54' # WHS stabilised
include:
# 14.0.3 requires the WHS flag
- next-version: '14.0.3'
window-history-support: true
# Current latest is 14.0.4
- next-version: latest
window-history-support: true
- next-version: latest
window-history-support: true
base-path: '/base'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598
with:
version: 8
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8
with:
node-version: lts/*
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Install Next.js version ${{ matrix.next-version }}
run: pnpm add --filter e2e next@${{ matrix.next-version }}
- name: Run integration tests
run: pnpm run test
env:
BASE_PATH: ${{ matrix.base-path && matrix.base-path || '/' }}
WINDOW_HISTORY_SUPPORT: ${{ matrix.window-history-support }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
- name: Save Cypress artifacts
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392
if: failure()
with:
path: packages/e2e/cypress/screenshots
name: ci-${{ matrix.next-version }}${{ matrix.base-path && '-basePath' || ''}}${{ matrix.window-history-support && '-whs' || ''}}
- uses: 47ng/actions-slack-notify@main
name: Notify on Slack
if: always()
with:
status: ${{ job.status }}
jobName: next@${{ matrix.next-version }}${{ matrix.base-path && ' basePath' || ''}}${{ matrix.window-history-support && ' WHS' || ''}}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
cd:
name: Deployment
runs-on: ubuntu-latest
needs: [ci]
if: ${{ github.ref_name == 'master' || github.ref_name == 'beta' }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598
with:
version: 8
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8
with:
node-version: lts/*
cache: pnpm
# Note: we do not use an external Turbo cache for publishing
# to prevent against possible cache collision attacks.
- name: Install dependencies
run: pnpm install --ignore-scripts --frozen-lockfile
- name: Build package
run: pnpm build --filter nuqs
- name: Semantic Release
run: ../../node_modules/.bin/semantic-release
working-directory: packages/nuqs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Mirror to next-usequerystate
run: ./scripts/mirror.sh
working-directory: packages/nuqs
continue-on-error: true
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}