-
Notifications
You must be signed in to change notification settings - Fork 291
89 lines (89 loc) · 2.5 KB
/
Copy pathpublish.yml
File metadata and controls
89 lines (89 loc) · 2.5 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
name: Test
on:
push:
pull_request:
# See https://docs.npmjs.com/trusted-publishers
permissions:
id-token: write # Required for NPM integration with OIDC
contents: read
jobs:
is_release:
runs-on: ubuntu-latest
outputs:
type: ${{ steps.get_type.outputs.type }}
continue-on-error: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: get_type
run: echo $( git tag --points-at HEAD | grep -q -e '^.*@.*$' && echo 'type=::release::' || echo "type=::norelease::" ) >> "$GITHUB_OUTPUT"
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x, 24.x]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci --ignore-scripts
- run: npm rebuild duckdb
- run: npm run test
# test_16:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [16.x]
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node-version }}
# - run: npm install
# - run: npm run test:16
# test_legacy:
# needs: [is_release]
# if: ${{ needs.is_release.outputs.type == '::norelease::' }}
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [14.x]
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node-version }}
# - run: |
# cwd=`pwd`
# for pkg in packages/*/package.json; do
# cd $cwd/`dirname $pkg`
# npm install
# npm run test:legacy;
# done
publish:
needs: [is_release, test]
if: ${{ needs.is_release.outputs.type == '::release::' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "24.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci --ignore-scripts
- run: npm run publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}