Skip to content

Commit da06daa

Browse files
chore(CI): add automatic release (#4)
1 parent 574ace4 commit da06daa

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

.github/workflows/ci.yml

+50-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
@@ -50,7 +57,49 @@ jobs:
5057
- name: 📥 Install dependencies
5158
run: npm install
5259

60+
- name: 🏗 Build
61+
run: npm run build
62+
5363
- name: ▶️ Run test script
5464
run: npm run test
5565
- name: ⬆️ Upload coverage report
5666
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eslint-community/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)