Skip to content

Commit b33cd49

Browse files
committed
chore(CI): add automatic release
1 parent debaf8a commit b33cd49

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

.github/workflows/ci.yml

+47-1
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
@@ -54,3 +61,42 @@ jobs:
5461
run: npm run test
5562
- name: ⬆️ Upload coverage report
5663
uses: codecov/codecov-action@v3
64+
65+
release:
66+
name: 🚀 Release
67+
needs: [lint, test]
68+
runs-on: ubuntu-latest
69+
if: github.repository == 'eslint-community/regexpp' &&
70+
contains('refs/heads/main,refs/heads/next,refs/heads/beta,refs/heads/alpha',
71+
github.ref) && github.event_name == 'push'
72+
steps:
73+
- name: 🛑 Cancel Previous Runs
74+
uses: styfle/[email protected]
75+
76+
- name: ⬇️ Checkout repo
77+
uses: actions/checkout@v3
78+
79+
- name: ⎔ Setup Node
80+
uses: actions/setup-node@v3
81+
with:
82+
node-version: 18
83+
84+
- name: 📥 Install dependencies
85+
run: npm install
86+
87+
- name: 🚀 Release
88+
uses: cycjimmy/semantic-release-action@v3
89+
with:
90+
semantic_version: 19
91+
branches: |
92+
[
93+
'+([0-9])?(.{+([0-9]),x}).x',
94+
'main',
95+
'next',
96+
'next-major',
97+
{name: 'beta', prerelease: true},
98+
{name: 'alpha', prerelease: true}
99+
]
100+
env:
101+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "regexpp",
3-
"version": "3.2.0",
3+
"version": "0.0.0-semantically-released",
44
"description": "Regular expression parser for ECMAScript.",
55
"engines": {
66
"node": ">=8"

0 commit comments

Comments
 (0)