|
1 | | - name: ci |
| 1 | +name: ci |
2 | 2 |
|
3 | | - on: |
4 | | - push: |
5 | | - workflow_dispatch: {} |
| 3 | +on: |
| 4 | + push: |
| 5 | + workflow_dispatch: {} |
6 | 6 |
|
7 | | - concurrency: |
8 | | - group: ${{ github.workflow }}-${{ github.ref }} |
9 | | - cancel-in-progress: false |
| 7 | +concurrency: |
| 8 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 9 | + cancel-in-progress: false |
10 | 10 |
|
11 | | - jobs: |
12 | | - compile: |
13 | | - runs-on: ubuntu-latest |
| 11 | +jobs: |
| 12 | + compile: |
| 13 | + runs-on: ubuntu-latest |
14 | 14 |
|
15 | | - steps: |
16 | | - - name: Checkout repo |
17 | | - uses: actions/checkout@v6 |
| 15 | + steps: |
| 16 | + - name: Checkout repo |
| 17 | + uses: actions/checkout@v6 |
18 | 18 |
|
19 | | - - name: Set up node |
20 | | - uses: actions/setup-node@v6 |
| 19 | + - name: Set up node |
| 20 | + uses: actions/setup-node@v6 |
21 | 21 |
|
22 | | - - name: Install pnpm |
23 | | - uses: pnpm/action-setup@v4 |
| 22 | + - name: Install pnpm |
| 23 | + uses: pnpm/action-setup@v4 |
24 | 24 |
|
25 | | - - name: Install dependencies |
26 | | - run: pnpm install --frozen-lockfile |
| 25 | + - name: Install dependencies |
| 26 | + run: pnpm install --frozen-lockfile |
27 | 27 |
|
28 | | - - name: Compile |
29 | | - run: pnpm build |
| 28 | + - name: Compile |
| 29 | + run: pnpm build |
30 | 30 |
|
31 | | - test: |
32 | | - runs-on: ubuntu-latest |
| 31 | + test: |
| 32 | + runs-on: ubuntu-latest |
33 | 33 |
|
34 | | - steps: |
35 | | - - name: Checkout repo |
36 | | - uses: actions/checkout@v6 |
| 34 | + steps: |
| 35 | + - name: Checkout repo |
| 36 | + uses: actions/checkout@v6 |
37 | 37 |
|
38 | | - - name: Set up node |
39 | | - uses: actions/setup-node@v6 |
| 38 | + - name: Set up node |
| 39 | + uses: actions/setup-node@v6 |
40 | 40 |
|
41 | | - - name: Install pnpm |
42 | | - uses: pnpm/action-setup@v4 |
| 41 | + - name: Install pnpm |
| 42 | + uses: pnpm/action-setup@v4 |
43 | 43 |
|
44 | | - - name: Install dependencies |
45 | | - run: pnpm install --frozen-lockfile |
| 44 | + - name: Install dependencies |
| 45 | + run: pnpm install --frozen-lockfile |
46 | 46 |
|
47 | | - - name: Test |
48 | | - run: pnpm test |
| 47 | + - name: Test |
| 48 | + run: pnpm test |
49 | 49 |
|
50 | | - publish: |
51 | | - needs: [ compile, test ] |
52 | | - if: ${{ github.event_name == 'workflow_dispatch' || contains(github.ref, 'refs/tags/') }} |
53 | | - runs-on: ubuntu-latest |
54 | | - permissions: |
55 | | - contents: read |
56 | | - id-token: write |
57 | | - steps: |
58 | | - - name: Checkout repo |
59 | | - uses: actions/checkout@v6 |
| 50 | + publish: |
| 51 | + needs: [ compile, test ] |
| 52 | + if: ${{ github.event_name == 'workflow_dispatch' || contains(github.ref, 'refs/tags/') }} |
| 53 | + runs-on: ubuntu-latest |
| 54 | + permissions: |
| 55 | + contents: read |
| 56 | + id-token: write |
| 57 | + steps: |
| 58 | + - name: Checkout repo |
| 59 | + uses: actions/checkout@v6 |
60 | 60 |
|
61 | | - - name: Set up node |
62 | | - uses: actions/setup-node@v6 |
| 61 | + - name: Set up node |
| 62 | + uses: actions/setup-node@v6 |
63 | 63 |
|
64 | | - - name: Update npm |
65 | | - run: sudo npm install -g npm@11.5.1 |
| 64 | + - name: Update npm |
| 65 | + run: sudo npm install -g npm@11.5.1 |
66 | 66 |
|
67 | | - - name: Install pnpm |
68 | | - uses: pnpm/action-setup@v4 |
| 67 | + - name: Install pnpm |
| 68 | + uses: pnpm/action-setup@v4 |
69 | 69 |
|
70 | | - - name: Install dependencies |
71 | | - run: pnpm install --frozen-lockfile |
| 70 | + - name: Install dependencies |
| 71 | + run: pnpm install --frozen-lockfile |
72 | 72 |
|
73 | | - - name: Build |
74 | | - run: pnpm build |
| 73 | + - name: Build |
| 74 | + run: pnpm build |
75 | 75 |
|
76 | | - - name: Publish to npm |
77 | | - run: | |
78 | | - if [[ ${GITHUB_REF} == *alpha* ]]; then |
79 | | - npm publish --access public --tag alpha |
80 | | - elif [[ ${GITHUB_REF} == *beta* ]]; then |
81 | | - npm publish --access public --tag beta |
82 | | - else |
83 | | - npm publish --access public |
84 | | - fi |
| 76 | + - name: Publish to npm |
| 77 | + run: | |
| 78 | + if [[ ${GITHUB_REF} == *alpha* ]]; then |
| 79 | + npm publish --access public --tag alpha |
| 80 | + elif [[ ${GITHUB_REF} == *beta* ]]; then |
| 81 | + npm publish --access public --tag beta |
| 82 | + else |
| 83 | + npm publish --access public |
| 84 | + fi |
0 commit comments