|
1 | 1 | name: Publish
|
2 | 2 | on:
|
3 |
| - push: |
4 |
| - branches: |
5 |
| - - main |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
6 | 6 | jobs:
|
7 |
| - npm-publish: |
8 |
| - name: npm-publish |
9 |
| - runs-on: ubuntu-latest |
10 |
| - steps: |
11 |
| - - name: Checkout repository |
12 |
| - uses: actions/checkout@v4 |
13 |
| - with: |
14 |
| - fetch-depth: 0 |
15 |
| - - id: check |
16 |
| - |
17 |
| - with: |
18 |
| - diff-search: true |
19 |
| - - name: Set up Node |
20 |
| - if: steps.check.outputs.changed == 'true' |
21 |
| - uses: actions/setup-node@v4 |
22 |
| - with: |
23 |
| - node-version: "20" |
24 |
| - - name: Install |
25 |
| - if: steps.check.outputs.changed == 'true' |
26 |
| - run: yarn |
27 |
| - - name: Build |
28 |
| - if: steps.check.outputs.changed == 'true' |
29 |
| - run: yarn build |
30 |
| - - name: Test |
31 |
| - if: steps.check.outputs.changed == 'true' |
32 |
| - run: yarn test |
33 |
| - - name: Setup publish token |
34 |
| - if: steps.check.outputs.changed == 'true' |
35 |
| - run: echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc |
36 |
| - env: |
37 |
| - NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} |
38 |
| - - name: Publish |
39 |
| - if: steps.check.outputs.changed == 'true' |
40 |
| - run: | |
41 |
| - yarn publish --non-interactive |
42 |
| - git tag v$(jq '.version' package.json -r) |
43 |
| - git push --tags |
| 7 | + npm-publish: |
| 8 | + name: npm-publish |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - name: Checkout repository |
| 12 | + uses: actions/checkout@v4 |
| 13 | + with: |
| 14 | + fetch-depth: 0 |
| 15 | + - id: check |
| 16 | + |
| 17 | + with: |
| 18 | + diff-search: true |
| 19 | + - name: Set up Node |
| 20 | + if: steps.check.outputs.changed == 'true' |
| 21 | + uses: actions/setup-node@v4 |
| 22 | + with: |
| 23 | + node-version: "20" |
| 24 | + - name: Install |
| 25 | + if: steps.check.outputs.changed == 'true' |
| 26 | + run: yarn |
| 27 | + - name: Build |
| 28 | + if: steps.check.outputs.changed == 'true' |
| 29 | + run: yarn build |
| 30 | + - name: Test |
| 31 | + if: steps.check.outputs.changed == 'true' |
| 32 | + run: yarn test |
| 33 | + - name: Setup publish token |
| 34 | + if: steps.check.outputs.changed == 'true' |
| 35 | + run: echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc |
| 36 | + env: |
| 37 | + NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} |
| 38 | + - name: Publish |
| 39 | + if: steps.check.outputs.changed == 'true' |
| 40 | + run: | |
| 41 | + yarn publish --non-interactive |
| 42 | + git tag v$(jq '.version' package.json -r) |
| 43 | + git push --tags |
0 commit comments