Skip to content

Commit 52628c3

Browse files
committed
chore(CI): add automatic release (#14)
1 parent eea507b commit 52628c3

File tree

2 files changed

+49
-2
lines changed

2 files changed

+49
-2
lines changed

.github/workflows/CI.yml

Lines changed: 48 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
@@ -110,3 +117,43 @@ jobs:
110117

111118
- name: ⬆️ Upload coverage report
112119
uses: codecov/codecov-action@v3
120+
121+
release:
122+
name: 🚀 Release
123+
needs: [ lint, test ]
124+
runs-on: ubuntu-latest
125+
if:
126+
github.repository == 'eslint-community/eslint-plugin-eslint-comments' &&
127+
contains('refs/heads/main,refs/heads/next,refs/heads/beta,refs/heads/alpha',
128+
github.ref) && github.event_name == 'push'
129+
steps:
130+
- name: 🛑 Cancel Previous Runs
131+
uses: styfle/[email protected]
132+
133+
- name: ⬇️ Checkout repo
134+
uses: actions/checkout@v3
135+
136+
- name: ⎔ Setup node
137+
uses: actions/setup-node@v3
138+
with:
139+
node-version: 18
140+
141+
- name: 📥 Install dependencies
142+
run: npm install --legacy-peer-deps
143+
144+
- name: 🚀 Release
145+
uses: cycjimmy/semantic-release-action@v3
146+
with:
147+
semantic_version: 19
148+
branches: |
149+
[
150+
'+([0-9])?(.{+([0-9]),x}).x',
151+
'main',
152+
'next',
153+
'next-major',
154+
{name: 'beta', prerelease: true},
155+
{name: 'alpha', prerelease: true}
156+
]
157+
env:
158+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
159+
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-plugin-eslint-comments",
3-
"version": "3.2.0",
3+
"version": "0.0.0-semantically-released",
44
"description": "Additional ESLint rules for ESLint directive comments.",
55
"engines": {
66
"node": ">=6.5.0"

0 commit comments

Comments
 (0)