Skip to content

Commit 3cf95ac

Browse files
committed
chore(CI): add automatic release
1 parent 5c44fe8 commit 3cf95ac

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/main.yml

+42
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: CI
22
on:
33
push:
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
412
pull_request:
513

614
jobs:
@@ -72,3 +80,37 @@ jobs:
7280
- name: ⬆️ Upload coverage report
7381
uses: codecov/codecov-action@v3
7482

83+
release:
84+
needs: [lint, test]
85+
runs-on: ubuntu-latest
86+
if: github.repository == 'eslint-community/eslint-plugin-eslint-plugin' &&
87+
contains('refs/heads/main,refs/heads/next,refs/heads/beta,refs/heads/alpha',
88+
github.ref) && github.event_name == 'push'
89+
steps:
90+
- name: 🛑 Cancel Previous Runs
91+
uses: styfle/[email protected]
92+
93+
- name: ⬇️ Checkout repo
94+
uses: actions/checkout@v3
95+
96+
- name: ⎔ Setup node
97+
uses: actions/setup-node@v3
98+
with:
99+
node-version: 18
100+
101+
- name: 🚀 Release
102+
uses: cycjimmy/semantic-release-action@v3
103+
with:
104+
semantic_version: 19
105+
branches: |
106+
[
107+
'+([0-9])?(.{+([0-9]),x}).x',
108+
'main',
109+
'next',
110+
'next-major',
111+
{name: 'beta', prerelease: true},
112+
{name: 'alpha', prerelease: true}
113+
]
114+
env:
115+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)