|
8 | 8 | pull_request: {} |
9 | 9 | workflow_dispatch: |
10 | 10 |
|
11 | | -permissions: {} |
12 | | - |
| 11 | +permissions: |
| 12 | + contents: read |
13 | 13 | concurrency: |
14 | 14 | group: ${{ github.workflow }}-${{ github.ref }} |
15 | 15 | cancel-in-progress: true |
16 | 16 |
|
17 | 17 | jobs: |
18 | | - build_test_release: |
| 18 | + build_test: |
19 | 19 | permissions: |
20 | | - id-token: write # to enable use of OIDC (npm trusted publishing and provenance) |
21 | | - actions: write # to cancel/stop running workflows (styfle/cancel-workflow-action) |
22 | | - contents: write # to create release tags (cycjimmy/semantic-release-action) |
23 | | - issues: write # to post release that resolves an issue (cycjimmy/semantic-release-action) |
24 | | - pull-requests: write # to be able to comment on released pull requests |
| 20 | + contents: read |
25 | 21 |
|
26 | 22 | strategy: |
27 | 23 | matrix: |
|
58 | 54 | - name: lint |
59 | 55 | run: npm run lint |
60 | 56 | timeout-minutes: 5 |
| 57 | + |
| 58 | + build-release-artifact: |
| 59 | + needs: build_test |
| 60 | + runs-on: ubuntu-latest |
| 61 | + permissions: |
| 62 | + contents: read |
| 63 | + if: ${{ github.repository == 'testing-library/angular-testing-library' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta') && github.event_name == 'push' }} |
| 64 | + steps: |
| 65 | + - name: Checkout repo |
| 66 | + uses: actions/checkout@v6 |
| 67 | + |
| 68 | + - name: Setup node |
| 69 | + uses: actions/setup-node@v5 |
| 70 | + with: |
| 71 | + node-version: 24 |
| 72 | + |
| 73 | + - name: Update npm |
| 74 | + run: npm install -g npm@latest |
| 75 | + |
| 76 | + - name: Install dependencies |
| 77 | + run: npm install --force --ignore-scripts |
| 78 | + |
| 79 | + - name: 📦 Prepare package |
| 80 | + run: npm run build |
| 81 | + timeout-minutes: 5 |
| 82 | + |
| 83 | + - name: 📦 Upload package artifact |
| 84 | + uses: actions/upload-artifact@v4 |
| 85 | + with: |
| 86 | + name: npm-package-dist |
| 87 | + path: dist/@testing-library/angular |
| 88 | + if-no-files-found: error |
| 89 | + retention-days: 7 |
| 90 | + |
| 91 | + release: |
| 92 | + needs: build-release-artifact |
| 93 | + runs-on: ubuntu-latest |
| 94 | + permissions: |
| 95 | + id-token: write # to enable use of OIDC (npm trusted publishing and provenance) |
| 96 | + contents: write # to create release tags (cycjimmy/semantic-release-action) |
| 97 | + issues: write # to post release that resolves an issue (cycjimmy/semantic-release-action) |
| 98 | + pull-requests: write # to be able to comment on released pull requests |
| 99 | + if: ${{ github.repository == 'testing-library/angular-testing-library' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta') && github.event_name == 'push' }} |
| 100 | + steps: |
| 101 | + - name: Checkout repo |
| 102 | + uses: actions/checkout@v6 |
| 103 | + |
| 104 | + - name: Setup node |
| 105 | + uses: actions/setup-node@v5 |
| 106 | + with: |
| 107 | + node-version: 24 |
| 108 | + registry-url: 'https://registry.npmjs.org' |
| 109 | + |
| 110 | + - name: 📦 Download package artifact |
| 111 | + uses: actions/download-artifact@v4 |
| 112 | + with: |
| 113 | + name: npm-package-dist |
| 114 | + path: dist/@testing-library/angular |
| 115 | + |
61 | 116 | - name: 🚀 Release |
62 | | - if: github.repository == 'testing-library/angular-testing-library' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta') |
63 | 117 | uses: cycjimmy/semantic-release-action@v6 |
64 | 118 | with: |
65 | 119 | semantic_version: 25 |
|
0 commit comments