|
6 | 6 | pull_request:
|
7 | 7 | branches: [main]
|
8 | 8 |
|
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
9 | 12 | jobs:
|
10 |
| - build: |
| 13 | + bundle-and-lint: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + - uses: actions/setup-node@v4 |
| 18 | + with: |
| 19 | + node-version: 20.x |
| 20 | + - run: npm ci |
| 21 | + - run: npx --no-install microbundle |
| 22 | + - run: npx --no-install eslint src |
| 23 | + |
| 24 | + test: |
| 25 | + needs: bundle-and-lint |
11 | 26 | runs-on: ubuntu-latest
|
12 | 27 |
|
13 | 28 | strategy:
|
14 | 29 | matrix:
|
15 |
| - # Reduce at EOL - https://nodejs.org/en/about/releases/ |
16 |
| - node-version: [14.x, 16.x, 18.x] |
| 30 | + # Reduce at EOL - https://github.com/nodejs/Release |
| 31 | + node-version: [18.x, 20.x] |
17 | 32 |
|
18 | 33 | steps:
|
19 |
| - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 |
20 |
| - - name: Use Node.js ${{ matrix.node-version }} |
21 |
| - uses: actions/setup-node@v4 |
| 34 | + - uses: actions/checkout@v4 |
| 35 | + - uses: actions/setup-node@v4 |
22 | 36 | with:
|
23 | 37 | node-version: ${{ matrix.node-version }}
|
24 | 38 | - run: npm ci
|
25 |
| - - run: npx --no-install microbundle |
26 |
| - - run: npx --no-install eslint src |
27 | 39 | - run: npx --no-install jest
|
28 |
| - - name: Codecov |
29 |
| - |
30 |
| - - run: npx --no-install semantic-release |
31 |
| - if: matrix.node-version == '18.x' |
| 40 | + |
| 41 | + release: |
| 42 | + needs: test |
| 43 | + if: success() && github.ref == 'refs/heads/main' |
| 44 | + runs-on: ubuntu-latest |
| 45 | + permissions: |
| 46 | + contents: write # to be able to publish a GitHub release |
| 47 | + issues: write # to be able to comment on released issues |
| 48 | + pull-requests: write # to be able to comment on released pull requests |
| 49 | + id-token: write # to enable use of OIDC for npm provenance |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@v4 |
| 52 | + with: |
| 53 | + fetch-depth: 0 |
| 54 | + - uses: actions/setup-node@v4 |
| 55 | + with: |
| 56 | + node-version: 20.x |
| 57 | + - run: npm ci |
| 58 | + - run: npx --no-install microbundle |
| 59 | + - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies |
| 60 | + run: npm audit signatures |
| 61 | + - name: Release |
32 | 62 | env:
|
33 |
| - GH_TOKEN: ${{ secrets.GH_TOKEN }} |
| 63 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
34 | 64 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
| 65 | + run: npx semantic-release |
0 commit comments