|
1 | 1 | name: 'Test & Release'
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
5 |
| - branches: |
6 |
| - - main |
7 |
| - pull_request: |
8 |
| - branches: |
9 |
| - - main |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
10 | 10 |
|
11 | 11 | jobs:
|
12 |
| - test: |
13 |
| - name: 'Test package' |
14 |
| - runs-on: ubuntu-latest |
15 |
| - |
16 |
| - steps: |
17 |
| - - uses: actions/checkout@v4 |
18 |
| - |
19 |
| - - uses: actions/setup-node@v4 |
20 |
| - with: |
21 |
| - node-version: '22' |
22 |
| - cache: 'npm' |
23 |
| - |
24 |
| - - name: Install |
25 |
| - run: | |
26 |
| - npm install |
27 |
| - npm run dev:prepare |
28 |
| -
|
29 |
| - - name: Lint |
30 |
| - run: | |
31 |
| - npm run lint:es |
32 |
| - npm run lint:types |
33 |
| -
|
34 |
| - - name: Test |
35 |
| - run: npm run test |
36 |
| - |
37 |
| - release: |
38 |
| - name: 'Release package' |
39 |
| - needs: [ test ] |
40 |
| - runs-on: ubuntu-latest |
41 |
| - if: | |
42 |
| - github.event_name == 'push' && |
43 |
| - !contains(github.event.head_commit.message, '/renovate/') && |
44 |
| - !contains(github.event.head_commit.message, '[skip-release]') |
45 |
| -
|
46 |
| - steps: |
47 |
| - - uses: actions/checkout@v4 |
48 |
| - |
49 |
| - - uses: actions/setup-node@v4 |
50 |
| - with: |
51 |
| - node-version: '22' |
52 |
| - cache: 'npm' |
53 |
| - |
54 |
| - - name: Install |
55 |
| - run: | |
56 |
| - npm install |
57 |
| - npm run dev:prepare |
58 |
| -
|
59 |
| - - name: Release |
60 |
| - run: | |
61 |
| - npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISHING_KEY }} |
62 |
| - npm run release:ci |
63 |
| -
|
64 |
| - bump-version: |
65 |
| - name: 'Bump package version' |
66 |
| - needs: [ test ] |
67 |
| - runs-on: ubuntu-latest |
68 |
| - if: | |
69 |
| - github.event_name == 'push' && |
70 |
| - contains(github.event.head_commit.message, '/renovate/') |
71 |
| -
|
72 |
| - steps: |
73 |
| - - uses: actions/checkout@v4 |
74 |
| - |
75 |
| - - uses: actions/setup-node@v4 |
76 |
| - with: |
77 |
| - node-version: '22' |
78 |
| - cache: 'npm' |
79 |
| - |
80 |
| - - name: Install |
81 |
| - run: | |
82 |
| - npm install |
83 |
| - npm run dev:prepare |
84 |
| -
|
85 |
| - - name: Bump version |
86 |
| - id: bump_version |
87 |
| - run: | |
88 |
| - git config user.name "github-actions[bot]" |
89 |
| - git config user.email "github-actions[bot]@users.noreply.github.com" |
90 |
| -
|
91 |
| - NEW_VERSION=$(npm version patch -m "chore: bumped package version to %s") |
92 |
| - echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV |
93 |
| -
|
94 |
| - - name: Update CHANGELOG.md |
95 |
| - run: | |
96 |
| - echo -e "# $NEW_VERSION\n- Bumped dependencies\n\n$(cat CHANGELOG.md)" > CHANGELOG.md |
97 |
| - git add CHANGELOG.md |
98 |
| -
|
99 |
| - - name: Push changes |
100 |
| - run: | |
101 |
| - git commit --amend --no-edit |
102 |
| - git push origin main --tags |
103 |
| -
|
104 |
| - - name: Release new version |
105 |
| - run: | |
106 |
| - npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISHING_KEY }} |
107 |
| - npm run release:ci |
| 12 | + test: |
| 13 | + name: 'Test package' |
| 14 | + runs-on: ubuntu-latest |
| 15 | + |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - uses: actions/setup-node@v4 |
| 20 | + with: |
| 21 | + node-version: '22' |
| 22 | + cache: 'npm' |
| 23 | + |
| 24 | + - name: Install |
| 25 | + run: | |
| 26 | + npm install |
| 27 | + npm run dev:prepare |
| 28 | +
|
| 29 | + - name: Lint |
| 30 | + run: | |
| 31 | + npm run lint:es |
| 32 | + npm run lint:types |
| 33 | +
|
| 34 | + - name: Test |
| 35 | + run: npm run test |
| 36 | + |
| 37 | + release: |
| 38 | + name: 'Release package' |
| 39 | + needs: [ test ] |
| 40 | + runs-on: ubuntu-latest |
| 41 | + if: | |
| 42 | + github.event_name == 'push' && |
| 43 | + github.ref == 'refs/heads/main' && |
| 44 | + !contains(github.head_commit.message, '[skip-release]') && |
| 45 | + !startsWith(github.head_commit.message, 'chore: bumped package version') |
| 46 | +
|
| 47 | + steps: |
| 48 | + - uses: actions/checkout@v4 |
| 49 | + |
| 50 | + - uses: actions/setup-node@v4 |
| 51 | + with: |
| 52 | + node-version: '22' |
| 53 | + cache: 'npm' |
| 54 | + |
| 55 | + - name: Install |
| 56 | + run: | |
| 57 | + npm install |
| 58 | + npm run dev:prepare |
| 59 | +
|
| 60 | + - name: Release |
| 61 | + run: | |
| 62 | + npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISHING_KEY }} |
| 63 | + npm run release:ci |
| 64 | +
|
| 65 | + bump-version: |
| 66 | + name: 'Bump package version' |
| 67 | + needs: [ test ] |
| 68 | + runs-on: ubuntu-latest |
| 69 | + if: | |
| 70 | + github.event_name == 'push' && |
| 71 | + startsWith(github.ref, 'refs/heads/renovate/') |
| 72 | +
|
| 73 | + steps: |
| 74 | + - uses: actions/checkout@v4 |
| 75 | + |
| 76 | + - uses: actions/setup-node@v4 |
| 77 | + with: |
| 78 | + node-version: '22' |
| 79 | + cache: 'npm' |
| 80 | + |
| 81 | + - name: Install |
| 82 | + run: | |
| 83 | + npm install |
| 84 | + npm run dev:prepare |
| 85 | +
|
| 86 | + - name: Bump version |
| 87 | + id: bump_version |
| 88 | + run: | |
| 89 | + git config user.name "github-actions[bot]" |
| 90 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 91 | +
|
| 92 | + NEW_VERSION=$(npm version patch -m "chore: bumped package version to %s") |
| 93 | + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV |
| 94 | +
|
| 95 | + - name: Update CHANGELOG.md |
| 96 | + run: | |
| 97 | + echo -e "# $NEW_VERSION\n- Bumped dependencies\n\n$(cat CHANGELOG.md)" > CHANGELOG.md |
| 98 | + git add CHANGELOG.md |
| 99 | +
|
| 100 | + - name: Push changes |
| 101 | + run: | |
| 102 | + git commit --amend --no-edit |
| 103 | + git push origin main --tags |
| 104 | +
|
| 105 | + - name: Release new version |
| 106 | + run: | |
| 107 | + npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISHING_KEY }} |
| 108 | + npm run release:ci |
0 commit comments