-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (38 loc) · 1.38 KB
/
ci.yaml
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
name: ci
on:
workflow_dispatch: # allow manual trigger
pull_request: # on pull request changes
push:
branches: [main] # on commits to the main branch
jobs:
ci:
environment: ${{ github.ref == 'refs/heads/main' && 'publish' || 'test' }}
runs-on: ubuntu-latest
permissions:
contents: write # to publish releases
issues: write # to comment on released issues
pull-requests: write # to comment on released PRs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with: { node-version: 20.x }
- run: npm install -g pnpm@9
# Main tests.
- run: pnpm install --frozen-lockfile
- run: pnpm run test
- run: pnpm run build
- run: pnpm run type-check
# Validate that the tests pass without the pnpm overrides that alter
# the intra-monorepo dependencies for local development.
- run: cat package.json | jq 'del(.pnpm.overrides)' | tee package.json
- run: pnpm install --no-frozen-lockfile
- run: pnpm run test
# Validate that the prepublish hook works.
- run: pnpm run prepublish
# Finally, release (actual publishing only happens on the main branch).
- run: pnpm run release
env:
GITHUB_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}