|
1 | 1 | name: ci |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - v2 |
7 | | - - v3 |
8 | | - pull_request: |
9 | | - branches: |
10 | | - - v2 |
11 | | - - v3 |
| 4 | + push: { branches: [main] } |
| 5 | + pull_request: { branches: [main] } |
12 | 6 |
|
13 | 7 | jobs: |
14 | | - lint: |
15 | | - runs-on: ubuntu-latest |
16 | | - steps: |
17 | | - - uses: actions/checkout@v4 |
18 | | - with: |
19 | | - fetch-depth: 0 |
20 | | - - run: npm i -g --force corepack && corepack enable |
21 | | - - uses: actions/setup-node@v4 |
22 | | - with: |
23 | | - node-version: 22 |
24 | | - cache: pnpm |
25 | | - - run: pnpm install |
26 | | - - run: pnpm stub |
27 | | - - run: pnpm lint |
28 | | - |
29 | | - ci: |
| 8 | + tests: |
30 | 9 | runs-on: ${{ matrix.os }} |
31 | 10 | strategy: |
32 | 11 | matrix: |
33 | 12 | os: [ubuntu-latest, windows-latest] |
34 | 13 |
|
35 | 14 | steps: |
36 | | - - uses: actions/checkout@v4 |
37 | | - with: |
38 | | - fetch-depth: 0 |
| 15 | + - uses: actions/checkout@v5 |
39 | 16 | - run: npm i -g --force corepack && corepack enable |
40 | | - - uses: actions/setup-node@v4 |
41 | | - with: |
42 | | - node-version: 22 |
43 | | - cache: pnpm |
| 17 | + - uses: actions/setup-node@v5 |
| 18 | + with: { node-version: lts/*, cache: pnpm } |
44 | 19 | - uses: oven-sh/setup-bun@v2 |
45 | 20 | if: ${{ matrix.os != 'windows-latest' }} |
46 | | - with: |
47 | | - bun-version: latest |
| 21 | + with: { bun-version: latest } |
48 | 22 | - uses: denoland/setup-deno@v1 |
49 | 23 | if: ${{ matrix.os != 'windows-latest' }} |
50 | | - with: |
51 | | - deno-version: v2.x |
| 24 | + with: { deno-version: v2.x } |
52 | 25 | - run: pnpm install |
| 26 | + - run: pnpm stub && pnpm lint |
| 27 | + if: ${{ matrix.os != 'windows-latest' }} |
53 | 28 | - run: pnpm test:types |
54 | 29 | if: ${{ matrix.os != 'windows-latest' }} |
55 | 30 | - run: pnpm build |
56 | 31 | - run: pnpm vitest --coverage |
57 | | - env: |
58 | | - NODE_OPTIONS: --experimental-vm-modules --enable-source-maps |
59 | 32 | # - uses: codecov/codecov-action@v3 |
60 | | - - name: Release Nightly |
61 | | - if: | |
62 | | - github.event_name == 'push' && |
63 | | - !contains(github.event.head_commit.message, '[skip-release]') && |
64 | | - !startsWith(github.event.head_commit.message, 'chore') && |
65 | | - !startsWith(github.event.head_commit.message, 'docs') |
66 | | - run: ./scripts/release-nightly.sh |
67 | | - env: |
68 | | - NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}} |
| 33 | + |
| 34 | + publish: |
| 35 | + runs-on: ubuntu-latest |
| 36 | + permissions: { id-token: write, contents: read } |
| 37 | + needs: tests |
| 38 | + if: contains('refs/heads/main', github.ref) && github.event_name == 'push' |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v5 |
| 41 | + with: { fetch-depth: 0 } |
| 42 | + - run: npm i -fg corepack && corepack enable |
| 43 | + - uses: actions/setup-node@v5 |
| 44 | + with: { node-version: lts/*, cache: "pnpm" } |
| 45 | + - run: pnpm install |
| 46 | + - run: pnpm changelogen --bump --canary nightly |
| 47 | + - run: npm i -g npm@latest && npm publish --tag latest |
0 commit comments