ci: release via semantic release action #679
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - 'beta' | |
| pull_request: {} | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_test_release: | |
| permissions: | |
| id-token: write # to enable use of OIDC (npm trusted publishing and provenance) | |
| actions: write # to cancel/stop running workflows (styfle/cancel-workflow-action) | |
| contents: write # to create release tags (cycjimmy/semantic-release-action) | |
| issues: write # to post release that resolves an issue (cycjimmy/semantic-release-action) | |
| pull-requests: write # to be able to comment on released pull requests | |
| strategy: | |
| matrix: | |
| node-version: ${{ fromJSON((github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta') && '[22]' || '[20, 22, 24]') }} | |
| os: ${{ fromJSON((github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta') && '["ubuntu-latest"]' || '["ubuntu-latest", "windows-latest"]') }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: use Node.js ${{ matrix.node-version }} on ${{ matrix.os }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: install | |
| run: npm install --force | |
| - name: build | |
| run: npm run build | |
| timeout-minutes: 5 | |
| - name: test-library | |
| run: npm run test:testing-library | |
| timeout-minutes: 5 | |
| - name: test-examples | |
| run: npm run test:example-app | |
| timeout-minutes: 5 | |
| - name: test-examples-jest | |
| run: npm run test:jest-app | |
| timeout-minutes: 5 | |
| - name: test-karma-examples | |
| run: npm run test:karma-app -- --watch=false --no-progress | |
| timeout-minutes: 5 | |
| - name: lint | |
| run: npm run lint | |
| timeout-minutes: 5 | |
| - name: 🚀 Release | |
| if: github.repository == 'testing-library/angular-testing-library' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta') | |
| uses: cycjimmy/semantic-release-action@v5 | |
| with: | |
| semantic_version: 25 | |
| working_directory: './dist/@testing-library/angular' | |
| branches: | | |
| [ | |
| 'main', | |
| {name: 'beta', prerelease: true}, | |
| ] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |