1
1
name : CI
2
2
on :
3
3
push :
4
- branches : [main]
4
+ branches :
5
+ # default semantic-release branches
6
+ - +([0-9])?(.{+([0-9]),x}).x
7
+ - main
8
+ - next
9
+ - next-major
10
+ - beta
11
+ - alpha
5
12
pull_request :
6
13
schedule :
7
14
- cron : 0 0 * * 0
8
15
9
16
jobs :
10
17
lint :
18
+ name : ⬣ Lint
11
19
runs-on : ubuntu-latest
12
20
steps :
13
- - name : Checkout
21
+ - name : 🛑 Cancel Previous Runs
22
+
23
+
24
+ - name : ⬇️ Checkout repo
14
25
uses : actions/checkout@v3
15
26
16
- - name : Install Node
27
+ - name : ⎔ Setup Node
17
28
uses : actions/setup-node@v3
18
29
with :
19
30
node-version : 18
20
31
21
- - name : Install Packages
32
+ - name : 📥 Install dependencies
22
33
run : npm install
23
34
24
- - name : Lint
35
+ - name : ▶️ Run lint script
25
36
run : npm run lint
26
37
27
38
test :
28
- name : Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{ matrix.os }})
39
+ name :
40
+ 🧪 Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{
41
+ matrix.os }})
29
42
strategy :
30
43
matrix :
31
44
eslint : [6]
@@ -45,24 +58,65 @@ jobs:
45
58
os : ubuntu-latest
46
59
runs-on : ${{ matrix.os }}
47
60
steps :
48
- - name : Checkout
61
+ - name : 🛑 Cancel Previous Runs
62
+
63
+
64
+ - name : ⬇️ Checkout repo
49
65
uses : actions/checkout@v3
50
66
51
- - name : Install Node@ ${{ matrix.node }}
67
+ - name : ⎔ Setup Node v ${{ matrix.node }}
52
68
uses : actions/setup-node@v3
53
69
with :
54
70
node-version : ${{ matrix.node }}
55
71
56
- - name : Install Packages
72
+ - name : 📥 Install dependencies
57
73
run : npm install
58
74
59
- # - name: Install ESLint@ ${{ matrix.eslint }}
60
- # run: npm install eslint@${{ matrix.eslint }}
75
+ # - name: 📥 Install ESLint v ${{ matrix.eslint }}
76
+ # run: npm install --save-dev eslint@${{ matrix.eslint }}
61
77
62
- - name : Test
78
+ - name : ▶️ Run test script
63
79
run : npm run test
64
80
65
- # - name: Send Coverage
66
- # run: npm run -s codecov
67
- # env:
68
- # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
81
+ - name : ⬆️ Upload coverage report
82
+ uses : codecov/codecov-action@v3
83
+
84
+ release :
85
+ name : 🚀 Release
86
+ needs : [lint, test]
87
+ runs-on : ubuntu-latest
88
+ if :
89
+ github.repository == 'eslint-community/eslint-plugin-mysticatea' &&
90
+ contains('refs/heads/main,refs/heads/next,refs/heads/beta,refs/heads/alpha',
91
+ github.ref) && github.event_name == 'push'
92
+ steps :
93
+ - name : 🛑 Cancel Previous Runs
94
+
95
+
96
+ - name : ⬇️ Checkout repo
97
+ uses : actions/checkout@v3
98
+
99
+ - name : ⎔ Setup node
100
+ uses : actions/setup-node@v3
101
+ with :
102
+ node-version : 18
103
+
104
+ - name : 📥 Install dependencies
105
+ run : npm install
106
+
107
+ - name : 🚀 Release
108
+ uses : cycjimmy/semantic-release-action@v3
109
+ with :
110
+ semantic_version : 19
111
+ branches : |
112
+ [
113
+ '+([0-9])?(.{+([0-9]),x}).x',
114
+ 'main',
115
+ 'next',
116
+ 'next-major',
117
+ {name: 'beta', prerelease: true},
118
+ {name: 'alpha', prerelease: true}
119
+ ]
120
+ env :
121
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
122
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments