-
Notifications
You must be signed in to change notification settings - Fork 206
120 lines (104 loc) · 3.52 KB
/
validate.yml
File metadata and controls
120 lines (104 loc) · 3.52 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
name: validate
on:
push:
branches:
- '+([0-9])?(.{+([0-9]),x}).x'
- 'main'
- 'next'
- 'next-major'
- 'beta'
- 'alpha'
- '!all-contributors/**'
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
main:
# ignore all-contributors PRs
if: ${{ !contains(github.head_ref, 'all-contributors') }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [lts/-1, lts/*, latest]
runs-on: ${{ matrix.os }}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: ⎔ Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ matrix.node }}
- name: 📥 Download deps
uses: bahmutov/npm-install@20216767ca67f0f7b4d095dc5859c5700a6581cb # v1
with:
useLockFile: false
- name: ▶️ Run validate script
run: npm run validate
- name: ⬆️ Upload coverage report
uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3
build-release-artifact:
needs: main
runs-on: ubuntu-latest
permissions:
contents: read
if: ${{ github.repository == 'kentcdodds/kcd-scripts' && github.event_name == 'push' }}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: ⎔ Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: lts/*
- name: Install deps
run: npm install --ignore-scripts
- name: 🏗 Run build script
run: npm run build
- name: Upload package artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: npm-package-dist
path: dist
if-no-files-found: error
retention-days: 7
release:
needs: build-release-artifact
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
id-token: write # to enable use of OIDC for npm provenance
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
env:
NPM_CONFIG_PROVENANCE: 'true'
if: ${{ github.repository == 'kentcdodds/kcd-scripts' && github.event_name == 'push' }}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: ⎔ Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: lts/*
registry-url: https://registry.npmjs.org
- name: Download package artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: npm-package-dist
path: dist
- name: 🚀 Release
uses: cycjimmy/semantic-release-action@ba330626c4750c19d8299de843f05c7aa5574f62 # v5.0.2
with:
semantic_version: 25
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'next',
'next-major',
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}