|
1 |
| -name: Publish |
2 |
| - |
| 1 | +name: release |
3 | 2 | on:
|
4 | 3 | push:
|
5 | 4 | branches:
|
6 |
| - - "[12].[0-9x]+.[0-9x]+" |
7 | 5 | - main
|
8 | 6 | - next
|
9 |
| - - alpha |
10 |
| - - beta |
11 |
| - |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + - next |
12 | 11 | jobs:
|
13 |
| - tests: |
14 |
| - name: Test or Build |
| 12 | + build: |
15 | 13 | runs-on: ubuntu-latest
|
16 | 14 | steps:
|
17 | 15 | - uses: actions/checkout@v4
|
18 |
| - - name: Setup node |
19 |
| - uses: actions/setup-node@v4 |
20 |
| - with: |
21 |
| - node-version: 20 |
22 |
| - - id: vars |
23 |
| - name: Find Yarn's cache folder |
24 |
| - run: | |
25 |
| - echo "::set-output name=path::$(yarn config get cacheFolder)" |
26 |
| - echo "::set-output name=commithash::$(git rev-parse --short HEAD)" |
27 |
| - - name: Cache node modules |
28 |
| - uses: actions/cache@v4 |
29 |
| - id: yarn-cache |
30 |
| - with: |
31 |
| - path: ${{ steps.vars.outputs.path }} |
32 |
| - key: ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-${{ hashFiles('**/yarn.lock') }} |
33 |
| - restore-keys: | |
34 |
| - ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}- |
35 |
| - - name: Install dependencies |
36 |
| - # if: ${{ !steps.yarn-cache.outputs.cache-hit }} |
| 16 | + - uses: ./.github/actions/setup |
| 17 | + - uses: wagoid/commitlint-github-action@v6 |
37 | 18 | env:
|
38 |
| - CI: true |
39 |
| - run: | |
40 |
| - yarn install |
41 |
| - yarn ci |
| 19 | + NODE_PATH: ${{ github.workspace }}/node_modules |
| 20 | + |
42 | 21 | - name: Build
|
43 |
| - run: yarn run build |
| 22 | + run: yarn build |
| 23 | + |
44 | 24 | - name: Test
|
45 |
| - env: |
46 |
| - CI: true |
47 |
| - run: yarn run test --coverage |
| 25 | + run: yarn test |
48 | 26 |
|
49 |
| - publish: |
50 |
| - needs: tests |
51 |
| - name: Publish to Github & NPM or Github Package Registry |
| 27 | + - name: Upload coverage to Codecov |
| 28 | + uses: codecov/codecov-action@v4 |
| 29 | + |
| 30 | + release: |
| 31 | + needs: |
| 32 | + - build |
52 | 33 | runs-on: ubuntu-latest
|
53 | 34 | steps:
|
54 | 35 | - uses: actions/checkout@v4
|
55 |
| - - uses: actions/setup-node@v4 |
56 |
| - with: |
57 |
| - node-version: 12 |
58 |
| - - id: vars |
59 |
| - name: Find Yarn's cache folder |
60 |
| - run: | |
61 |
| - echo "::set-output name=path::$(yarn config get cacheFolder)" |
62 |
| - echo "::set-output name=commithash::$(git rev-parse --short HEAD)" |
63 |
| - - name: Cache node modules |
64 |
| - uses: actions/cache@v4 |
65 |
| - id: yarn-cache |
| 36 | + - uses: ./.github/actions/setup |
| 37 | + - name: Build |
| 38 | + run: yarn build |
| 39 | + |
| 40 | + - name: Semantic Release |
| 41 | + uses: cycjimmy/semantic-release-action@v4 |
66 | 42 | with:
|
67 |
| - path: ${{ steps.vars.outputs.path }} |
68 |
| - key: ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-${{ hashFiles('**/yarn.lock') }} |
69 |
| - restore-keys: | |
70 |
| - ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}- |
71 |
| - - name: Install dependencies |
72 |
| - # if: ${{ !steps.yarn-cache.outputs.cache-hit }} |
73 |
| - env: |
74 |
| - CI: true |
75 |
| - run: | |
76 |
| - yarn install |
77 |
| - yarn ci |
78 |
| - - if: success() |
| 43 | + semantic_version: 19.0.2 |
| 44 | + branches: | |
| 45 | + [ |
| 46 | + '+([0-9])?(.{+([0-9]),x}).x', |
| 47 | + 'main', |
| 48 | + 'next', |
| 49 | + 'next-major', |
| 50 | + { |
| 51 | + name: 'beta', |
| 52 | + prerelease: true |
| 53 | + }, |
| 54 | + { |
| 55 | + name: 'alpha', |
| 56 | + prerelease: true |
| 57 | + } |
| 58 | + ] |
| 59 | + extra_plugins: | |
| 60 | + @semantic-release/changelog |
| 61 | + @semantic-release/git |
| 62 | + @semrel-extra/npm |
79 | 63 | env:
|
80 |
| - CI: true |
81 | 64 | GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
82 | 65 | GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
83 | 66 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
84 |
| - run: yarn semantic-release |
| 67 | + GIT_AUTHOR_EMAIL: "[email protected]" |
| 68 | + GIT_COMMITTER_EMAIL: "[email protected]" |
| 69 | + GIT_AUTHOR_NAME: "anakmagang" |
| 70 | + GIT_COMMITTER_NAME: "anakmagang" |
0 commit comments