Skip to content

Commit 7719275

Browse files
chore(CI): add automatic release (#4)
1 parent 6f1927e commit 7719275

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

.github/workflows/CI.yml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
name: CI
22
on:
33
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
512
pull_request:
613
schedule:
714
- cron: 0 0 * * 0
@@ -85,3 +92,45 @@ jobs:
8592

8693
- name: ⬆️ Upload coverage report
8794
uses: codecov/codecov-action@v3
95+
96+
release:
97+
name: 🚀 Release
98+
needs: [lint, test]
99+
runs-on: ubuntu-latest
100+
if: github.repository == 'eslint-community/eslint-utils' &&
101+
contains('refs/heads/main,refs/heads/next,refs/heads/beta,refs/heads/alpha',
102+
github.ref) && github.event_name == 'push'
103+
steps:
104+
- name: 🛑 Cancel Previous Runs
105+
uses: styfle/[email protected]
106+
107+
- name: ⬇️ Checkout repo
108+
uses: actions/checkout@v3
109+
110+
- name: ⎔ Setup node
111+
uses: actions/setup-node@v3
112+
with:
113+
node-version: 18
114+
115+
- name: 📥 Install dependencies
116+
run: npm install
117+
118+
- name: 🏗 Build
119+
run: npm run build
120+
121+
- name: 🚀 Release
122+
uses: cycjimmy/semantic-release-action@v3
123+
with:
124+
semantic_version: 19
125+
branches: |
126+
[
127+
'+([0-9])?(.{+([0-9]),x}).x',
128+
'main',
129+
'next',
130+
'next-major',
131+
{name: 'beta', prerelease: true},
132+
{name: 'alpha', prerelease: true}
133+
]
134+
env:
135+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
136+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eslint-community/eslint-utils",
3-
"version": "3.0.0",
3+
"version": "0.0.0-semantically-released",
44
"description": "Utilities for ESLint plugins.",
55
"engines": {
66
"node": "^10.0.0 || ^12.0.0 || >= 14.0.0"

0 commit comments

Comments
 (0)