-
Notifications
You must be signed in to change notification settings - Fork 32
149 lines (126 loc) · 4.34 KB
/
release.yml
File metadata and controls
149 lines (126 loc) · 4.34 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: CI
on:
push:
branches: [main, next]
pull_request:
branches: [main, next]
schedule:
# Tuesdays at 14:45 UTC (10:45 EST)
- cron: 45 14 * * 1
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
main:
# ignore all-contributors PRs
if: ${{ !contains(github.head_ref, 'all-contributors') }}
name: Svelte ${{ matrix.svelte }}, Node ${{ matrix.node }}, ${{ matrix.check }}
runs-on: ubuntu-latest
needs: [build]
permissions:
id-token: write # codecov uploads
strategy:
fail-fast: false
matrix:
node: ['16', '18', '20', '22']
svelte: ['3', '4', '5']
check: ['test:vitest:jsdom', 'test:vitest:happy-dom', 'test:jest']
exclude:
# Don't run Svelte 3 on Node versions greater than 20
- { svelte: '3', node: '22' }
# Only run Svelte 5 on Node versions greater than or equal to 20
- { svelte: '5', node: '16' }
- { svelte: '5', node: '18' }
include:
# Only lint and test examples on latest Node and Svelte
- { svelte: '5', node: '22', check: 'lint' }
- { svelte: '5', node: '22', check: 'test:examples' }
# Run type checks in latest applicable Node
- { svelte: '3', node: '20', check: 'typecheck:legacy' }
- { svelte: '4', node: '22', check: 'typecheck:legacy' }
- { svelte: '5', node: '22', check: 'typecheck' }
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v6
- name: 🧱 Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
with:
standalone: ${{ matrix.node == '16' }}
- name: ⎔ Setup node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: 📥 Install dependencies
run: pnpm run install:${{ matrix.svelte }}
- name: 📥 Download build
uses: actions/download-artifact@v8
with:
name: build
path: packages
- name: ▶️ Run ${{ matrix.check }}
run: pnpm run ${{ matrix.check }}
- name: ⬆️ Upload coverage report
if: ${{ startsWith(matrix.check, 'test:') }}
uses: codecov/codecov-action@v5
with:
use_oidc: true
fail_ci_if_error: true
build:
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v6
- name: 🧱 Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: ⎔ Setup node
uses: actions/setup-node@v6
with:
node-version: 22
- name: 📥 Install dependencies
run: pnpm install
- name: 🏗️ Build types and documentation
run: pnpm run build
- name: ⬆️ Upload build
uses: actions/upload-artifact@v7
with:
name: build
path: |
packages/svelte/README.md
packages/svelte/dist
packages/svelte-core/dist
release:
needs: [main, build]
runs-on: ubuntu-latest
if: ${{ github.repository == 'testing-library/svelte-testing-library' &&
contains('refs/heads/main,refs/heads/next', github.ref) &&
github.event_name == 'push' }}
permissions:
contents: write # GitHub release publish
issues: write # released issues comments
pull-requests: write # released pull requests comments
id-token: write # trusted publishing and npm provenance
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v6
- name: 🧱 Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: ⎔ Setup node
uses: actions/setup-node@v6
with:
node-version: 24
- name: 📥 Download build
uses: actions/download-artifact@v8
with:
name: build
path: packages
- name: 🚀 Release
run: |
pnpm \
--package="@anolilab/multi-semantic-release@3" \
--package="@anolilab/semantic-release-pnpm@3" \
--package="semantic-release@25" \
--package="conventional-changelog-conventionalcommits@9" \
dlx \
multi-semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}