-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (81 loc) · 2.41 KB
/
ci.yaml
File metadata and controls
100 lines (81 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
HUSKY: 0
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x, 24.x]
steps:
- uses: actions/checkout@v6
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.10
- name: Set up Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.7.7
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Run tests
run: npm test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
fail_ci_if_error: true
- name: Enforce formatting
run: |
npm run format
release-please:
if: github.event_name == 'push'
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- id: release
uses: googleapis/release-please-action@v3
with:
release-type: node
package-name: '@sovereignbase/bytecodec'
publish:
if: needs.release-please.outputs.release_created == 'true'
needs: release-please
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '24'
registry-url: https://registry.npmjs.org
cache: npm
- run: npm ci
- run: npm run build --if-present
- run: npm publish --access public --ignore-scripts
- name: Sync jsr.json version from package.json
run: |
node -e "const fs=require('node:fs'); const pkg=JSON.parse(fs.readFileSync('package.json','utf8')); const jsr=JSON.parse(fs.readFileSync('jsr.json','utf8')); jsr.version=pkg.version; fs.writeFileSync('jsr.json', JSON.stringify(jsr, null, 2) + '\n');"
- name: Publish to JSR
run: npx jsr publish --allow-dirty