Skip to content

Commit b3cfc2d

Browse files
committed
chore(CI): add automatic release
1 parent bc7469d commit b3cfc2d

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

.github/workflows/ci.yml

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