Skip to content

Commit 7ee3bdd

Browse files
committed
chore: use shared reusable workflows from echecsjs/.github
1 parent fbc6123 commit 7ee3bdd

4 files changed

Lines changed: 9 additions & 156 deletions

File tree

.github/workflows/format.yml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,6 @@ on:
44
pull_request:
55
workflow_call:
66

7-
concurrency:
8-
group: format-${{ github.head_ref || github.ref }}
9-
cancel-in-progress: true
10-
117
jobs:
12-
default:
13-
name: 👔 Format
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: ⬇️ Checkout code
17-
uses: actions/checkout@v4
18-
19-
- name: 📦 Setup pnpm
20-
uses: pnpm/action-setup@v4
21-
with:
22-
version: latest
23-
24-
- name: ⎔ Setup node
25-
uses: actions/setup-node@v4
26-
with:
27-
cache: 'pnpm'
28-
node-version: 'node'
29-
30-
- name: 📥 Install dependencies
31-
run: pnpm install --frozen-lockfile
32-
33-
- name: 👔 Format
34-
run: pnpm run format:ci
8+
format:
9+
uses: echecsjs/.github/.github/workflows/format.yml@main

.github/workflows/lint.yml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,6 @@ on:
44
pull_request:
55
workflow_call:
66

7-
concurrency:
8-
group: lint-${{ github.head_ref || github.ref }}
9-
cancel-in-progress: true
10-
117
jobs:
12-
default:
13-
name: ⬣ Lint
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: ⬇️ Checkout code
17-
uses: actions/checkout@v4
18-
19-
- name: 📦 Setup pnpm
20-
uses: pnpm/action-setup@v4
21-
with:
22-
version: latest
23-
24-
- name: ⎔ Setup node
25-
uses: actions/setup-node@v4
26-
with:
27-
cache: 'pnpm'
28-
node-version: 'node'
29-
30-
- name: 📥 Install dependencies
31-
run: pnpm install --frozen-lockfile
32-
33-
- name: 🔬 Lint
34-
run: pnpm run lint:ci
8+
lint:
9+
uses: echecsjs/.github/.github/workflows/lint.yml@main

.github/workflows/release.yml

Lines changed: 2 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -7,73 +7,6 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
check:
11-
name: ✅ Check version
12-
outputs:
13-
changed: ${{ steps.check.outputs.changed }}
14-
version: ${{ steps.check.outputs.version }}
15-
runs-on: ubuntu-latest
16-
steps:
17-
- name: ⬇️ Checkout code
18-
uses: actions/checkout@v4
19-
20-
- id: check
21-
uses: EndBug/version-check@v2
22-
with:
23-
diff-search: true
24-
25-
format:
26-
name: 👔 Format
27-
uses: ./.github/workflows/format.yml
28-
29-
lint:
30-
name: 🔬 Lint
31-
uses: ./.github/workflows/lint.yml
32-
33-
test:
34-
name: 🧪 Test
35-
uses: ./.github/workflows/test.yml
36-
secrets: inherit
37-
3810
release:
39-
name: 🚀 Release
40-
permissions:
41-
id-token: write
42-
contents: write
43-
runs-on: ubuntu-latest
44-
needs: [check, format, lint, test]
45-
if:
46-
needs.check.outputs.changed == 'true' || github.event_name ==
47-
'workflow_dispatch'
48-
steps:
49-
- name: ⬇️ Checkout code
50-
uses: actions/checkout@v4
51-
52-
- name: 📦 Setup pnpm
53-
uses: pnpm/action-setup@v4
54-
with:
55-
version: latest
56-
57-
- name: ⎔ Setup node
58-
uses: actions/setup-node@v4
59-
with:
60-
cache: 'pnpm'
61-
node-version: 'node'
62-
registry-url: 'https://registry.npmjs.org'
63-
scope: '@echecs'
64-
65-
- name: 📥 Install dependencies
66-
run: pnpm install --frozen-lockfile
67-
68-
- name: Release to NPM
69-
run: pnpm publish --access public --provenance
70-
env:
71-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
72-
73-
- name: 🏷️ Create GitHub Release
74-
run: |
75-
VERSION="${{ needs.check.outputs.version }}"
76-
NOTES=$(awk -v ver="$VERSION" '/^## /{if(found)exit;v=$2;gsub(/[\[\]]/,"",v);if(v==ver){found=1;next}}found{print}' CHANGELOG.md)
77-
gh release create "v${VERSION}" --title "v${VERSION}" --notes "${NOTES}"
78-
env:
79-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
uses: echecsjs/.github/.github/workflows/release.yml@main
12+
secrets: inherit

.github/workflows/test.yml

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,7 @@ on:
44
pull_request:
55
workflow_call:
66

7-
concurrency:
8-
group: test-${{ github.head_ref || github.ref }}
9-
cancel-in-progress: true
10-
117
jobs:
12-
default:
13-
name: 🧪 Test
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: ⬇️ Checkout code
17-
uses: actions/checkout@v4
18-
19-
- name: 📦 Setup pnpm
20-
uses: pnpm/action-setup@v4
21-
with:
22-
version: latest
23-
24-
- name: ⎔ Setup node
25-
uses: actions/setup-node@v4
26-
with:
27-
cache: 'pnpm'
28-
node-version: 'node'
29-
30-
- name: 📥 Install dependencies
31-
run: pnpm install --frozen-lockfile
32-
33-
- name: 🧪 Test
34-
run: pnpm run test:coverage
35-
36-
- name: 📊 Upload coverage
37-
uses: codecov/codecov-action@v5
38-
with:
39-
token: ${{ secrets.CODECOV_TOKEN }}
40-
fail_ci_if_error: false
8+
test:
9+
uses: echecsjs/.github/.github/workflows/test.yml@main
10+
secrets: inherit

0 commit comments

Comments
 (0)