Skip to content

Commit e6d7564

Browse files
committed
chore: sematic-release
1 parent 29d9c3a commit e6d7564

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@ on:
44
push:
55
branches:
66
- main
7-
release:
8-
types:
9-
- created
107
pull_request:
118

129
jobs:
10+
commitlint:
11+
runs-on: ubuntu-latest
12+
13+
name: "Lint commit message"
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
- uses: wagoid/commitlint-github-action@v3
19+
1320
verify:
1421
runs-on: ubuntu-latest
1522

@@ -32,8 +39,9 @@ jobs:
3239
CI: true
3340

3441
publish:
35-
if: github.event_name == 'release' && github.event.action == 'created'
36-
needs: verify
42+
# publish only when merged in master on original repo, not on PR
43+
if: github.repository == 'DamianOsipiuk/vue-query' && github.ref == 'refs/heads/main'
44+
needs: [verify, commitlint]
3745
runs-on: ubuntu-latest
3846

3947
name: "Publish to NPM"
@@ -44,6 +52,7 @@ jobs:
4452
node-version: 14
4553
registry-url: https://registry.npmjs.org/
4654
- run: npm ci
47-
- run: npm publish
55+
- run: npx semantic-release@17 --branches main
4856
env:
4957
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTOMATION_TOKEN}}
58+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)