Skip to content

Commit 4e72dae

Browse files
committed
ci: improve the process for ci [skip check]
1 parent c5fee4f commit 4e72dae

File tree

3 files changed

+12
-27
lines changed

3 files changed

+12
-27
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
lint:
14-
if: "!contains(github.event.head_commit.message, 'skip ci')"
14+
if: "!contains(github.event.head_commit.message, '[skip check]')"
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v3
@@ -35,7 +35,7 @@ jobs:
3535
run: nr lint
3636

3737
typecheck:
38-
if: "!contains(github.event.head_commit.message, 'skip ci')"
38+
if: "!contains(github.event.head_commit.message, '[skip check]')"
3939
runs-on: ubuntu-latest
4040
steps:
4141
- uses: actions/checkout@v3
@@ -59,7 +59,7 @@ jobs:
5959
run: nr typecheck
6060

6161
test:
62-
if: "!contains(github.event.head_commit.message, 'skip ci')"
62+
if: "!contains(github.event.head_commit.message, '[skip check]')"
6363
runs-on: ${{ matrix.os }}
6464

6565
strategy:

.github/workflows/npm-publish.yml

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ name: Publish
55

66
on:
77
push:
8-
branches:
9-
- main
8+
tags:
9+
- 'v*'
1010

1111
jobs:
1212
publish-npm:
13-
if: "contains(github.event.head_commit.message, '[tag')"
13+
if: "!contains(github.event.head_commit.message, 'skip ci')"
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v3
@@ -20,25 +20,9 @@ jobs:
2020
with:
2121
node-version: '16'
2222
registry-url: https://registry.npmjs.org/
23-
cache: pnpm
24-
25-
- name: Setup
26-
run: npm i -g @antfu/ni
27-
28-
- name: Install
29-
run: nci
30-
31-
- if: "contains(github.event.head_commit.message, '[tag major]')"
32-
run: nr re-major
33-
- if: "contains(github.event.head_commit.message, '[tag minor]')"
34-
run: nr re-minor
35-
- if: "contains(github.event.head_commit.message, '[tag patch]')"
36-
run: nr re-patch
37-
38-
- run: git push --follow-tags origin main
39-
env:
40-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
41-
42-
- run: nr release
23+
- run: npm i -g pnpm
24+
- run: pnpm install
25+
- run: pnpm release
4326
env:
4427
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
28+

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
"typescript": "^4.9.4",
6262
"vite": "^4.0.1",
6363
"vitest": "^0.25.7",
64-
"tsup": "^6.5.0"
64+
"tsup": "^6.5.0",
65+
"release": "pnpm run build && pnpm publish --access public --no-git-checks"
6566
},
6667
"dependencies": {
6768
"@swc/core": "^1.3.22",

0 commit comments

Comments
 (0)