Skip to content

Commit aab355d

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

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

.github/workflows/CI.yml

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
name: CI
22
on:
3-
push:
4-
branches: [main]
3+
branches:
4+
# default semantic-release branches
5+
- +([0-9])?(.{+([0-9]),x}).x
6+
- main
7+
- next
8+
- next-major
9+
- beta
10+
- alpha
511
pull_request:
612
schedule:
713
- cron: 0 0 * * 0
@@ -110,3 +116,43 @@ jobs:
110116

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