-
-
Notifications
You must be signed in to change notification settings - Fork 2
111 lines (109 loc) · 2.87 KB
/
push.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
111
name: Node.js CI
on:
push:
branches: [main]
tags: [v*]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'npm'
node-version: '18'
- run: npm ci
- run: npm run lint
- run: npm run test:examples
- run: npm pack
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: package
path: codeyourfuture-eslint-config-standard-*.tgz
test-eslintrc:
runs-on: ubuntu-22.04
needs: build
strategy:
matrix:
eslint: [8.27, 8, 9]
node: [16, 18, 20]
exclude:
# ESLint v9 requires Node ^18.18.0 || ^20.9.0 || >=21.1.0
- eslint: 9
node: 16
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'npm'
node-version: ${{ matrix.node }}
- uses: actions/download-artifact@v4
with:
name: package
- run: npm ci
- run: npm run test:install
env:
ESLINT_USE_FLAT_CONFIG: 'false'
ESLINT_VERSION: ${{ matrix.eslint }}
PACK: 'false'
test-flat-config:
runs-on: ubuntu-22.04
needs: build
strategy:
matrix:
eslint: [8.27, 8, 9]
node: [16, 18, 20]
exclude:
# ESLint v9 requires Node ^18.18.0 || ^20.9.0 || >=21.1.0
- eslint: 9
node: 16
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'npm'
node-version: ${{ matrix.node }}
- uses: actions/download-artifact@v4
with:
name: package
- run: npm ci
- run: npm run test:install
env:
ESLINT_USE_FLAT_CONFIG: 'true'
ESLINT_VERSION: ${{ matrix.eslint }}
PACK: 'false'
deploy-github:
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/v')
needs: [test-eslintrc, test-flat-config]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: package
- run: |
gh release create \
'${{ github.ref_name }}' \
--title '${{ github.ref_name }}' \
codeyourfuture-eslint-config-standard-*.tgz
env:
GH_TOKEN: ${{ github.token }}
deploy-npm:
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/v')
needs: [test-eslintrc, test-flat-config]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_AUTH_TOKEN}"
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- uses: actions/download-artifact@v4
with:
name: package
- run: npm publish codeyourfuture-eslint-config-standard-*.tgz