-
Notifications
You must be signed in to change notification settings - Fork 162
62 lines (51 loc) · 1.73 KB
/
release.yml
File metadata and controls
62 lines (51 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Release
on:
push:
branches:
# semantic-release valid branches
- '+([0-9])?(.{+([0-9]),x}).x'
- 'main'
- 'next'
- 'next-major'
- 'beta'
- 'alpha'
concurrency:
group: release
cancel-in-progress: false
permissions:
id-token: write # to enable use of OIDC (npm trusted publishing and provenance)
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
jobs:
verifications:
name: Verifications
uses: ./.github/workflows/verifications.yml
publish:
name: Publish package
runs-on: ubuntu-latest
needs: [verifications]
# Avoid publishing in forks
if: github.repository == 'testing-library/eslint-plugin-testing-library'
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install pnpm
uses: pnpm/action-setup@903f9c1a6ebcba6cf41d87230be49611ac97822e # v6.0.3
- name: Set up Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
cache: 'pnpm'
node-version-file: '.nvmrc'
# Ensure npm 11.5.1 or later is installed for correct OIDC publishing
- name: Update npm
# (using v11.10.0 to avoid Node.js bug causing an installation failure) https://github.com/npm/cli/issues/9151
run: npm install -g npm@~11.10.0
- name: Install dependencies
run: pnpm install
- name: Build package
run: pnpm run build
- name: Release new version
run: pnpm exec semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}