Skip to content

Commit 3b8a547

Browse files
committed
ci: use reusable workflows
1 parent bd5268b commit 3b8a547

File tree

3 files changed

+15
-119
lines changed

3 files changed

+15
-119
lines changed
Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,10 @@
11
name: Publish Any Commit
2-
on:
3-
- push
4-
- pull_request
2+
on: [push, pull_request]
53

6-
jobs:
7-
build:
8-
runs-on: ubuntu-latest
9-
10-
steps:
11-
- name: Checkout code
12-
uses: actions/checkout@v4
13-
14-
- name: Install pnpm
15-
uses: pnpm/[email protected]
16-
17-
- uses: actions/setup-node@v4
18-
with:
19-
node-version: lts/*
20-
cache: pnpm
4+
permissions: {}
215

22-
- name: Install dependencies
23-
run: pnpm install
24-
25-
- name: Build
26-
run: pnpm build
27-
28-
- run: pnpm dlx [email protected] publish
6+
jobs:
7+
release:
8+
uses: sxzz/workflows/.github/workflows/release-commit.yml@v1
9+
with:
10+
compact: true

.github/workflows/release.yml

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,15 @@
11
name: Release
22

3-
permissions:
4-
contents: write
5-
63
on:
74
push:
85
tags:
96
- 'v*'
107

118
jobs:
129
release:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v4
16-
with:
17-
fetch-depth: 0
18-
19-
- name: Set node
20-
uses: actions/setup-node@v4
21-
with:
22-
node-version: lts/*
23-
24-
- run: npx changelogithub
25-
env:
26-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
27-
28-
publish-jsr:
29-
runs-on: ubuntu-latest
30-
10+
uses: sxzz/workflows/.github/workflows/release.yml@v1
11+
with:
12+
publish: false
3113
permissions:
32-
contents: read
14+
contents: write
3315
id-token: write
34-
35-
steps:
36-
- uses: actions/checkout@v4
37-
38-
- name: Install pnpm
39-
uses: pnpm/[email protected]
40-
41-
- name: Set node
42-
uses: actions/setup-node@v4
43-
with:
44-
node-version: lts/*
45-
cache: pnpm
46-
47-
- name: Install
48-
run: pnpm i
49-
50-
- name: Publish package
51-
run: npx jsr publish

.github/workflows/unit-test.yml

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,13 @@
11
name: Unit Test
22

3+
permissions: {}
4+
35
on:
46
push:
57
branches: [main]
68
pull_request:
79
branches: [main]
810

911
jobs:
10-
lint:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Checkout
14-
uses: actions/checkout@v4
15-
16-
- name: Install pnpm
17-
uses: pnpm/[email protected]
18-
19-
- name: Set node
20-
uses: actions/setup-node@v4
21-
with:
22-
node-version: lts/*
23-
cache: pnpm
24-
25-
- name: Install
26-
run: pnpm i
27-
28-
- name: Lint
29-
run: pnpm lint
30-
31-
- name: Typecheck
32-
run: pnpm typecheck
33-
34-
test:
35-
runs-on: ${{ matrix.os }}
36-
37-
strategy:
38-
matrix:
39-
os: [ubuntu-latest, windows-latest]
40-
node: [20, 22, 24]
41-
fail-fast: false
42-
43-
steps:
44-
- name: Checkout
45-
uses: actions/checkout@v4
46-
47-
- name: Install pnpm
48-
uses: pnpm/[email protected]
49-
50-
- name: Set node ${{ matrix.node }}
51-
uses: actions/setup-node@v4
52-
with:
53-
node-version: ${{ matrix.node }}
54-
cache: pnpm
55-
56-
- name: Install
57-
run: pnpm i
58-
59-
- name: Build
60-
run: pnpm run build
61-
62-
- name: Test
63-
run: pnpm run test
12+
unit-test:
13+
uses: sxzz/workflows/.github/workflows/unit-test.yml@v1

0 commit comments

Comments
 (0)