-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (106 loc) · 3.29 KB
/
ci.yml
File metadata and controls
112 lines (106 loc) · 3.29 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: write
issues: write
pull-requests: write
packages: write
id-token: write
jobs:
quality:
name: Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
- uses: pnpm/action-setup@v4
- run: pnpm install --frozen-lockfile
- uses: actions/cache@v5
with:
path: .turbo
key: turbo-quality-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }}
restore-keys: |
turbo-quality-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-
turbo-quality-${{ runner.os }}-
- run: npx turbo run _typecheck _test
docs:
name: Docs
runs-on: ubuntu-latest
needs: quality
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
- uses: pnpm/action-setup@v4
- run: pnpm install --frozen-lockfile
- uses: actions/cache@v5
with:
path: .turbo
key: turbo-docs-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }}
restore-keys: |
turbo-docs-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-
turbo-docs-${{ runner.os }}-
- run: npx turbo run _docs:cli _docs:api:html
- uses: actions/upload-pages-artifact@v3
with:
path: site/
pages:
name: Deploy Pages
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: docs
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- id: deploy
uses: actions/deploy-pages@v4
release:
name: Release
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: "24"
# Do NOT set registry-url — it creates an .npmrc that overrides OIDC
- uses: pnpm/action-setup@v4
- run: pnpm install --frozen-lockfile
- uses: actions/cache@v5
with:
path: .turbo
key: turbo-release-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }}
restore-keys: |
turbo-release-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-
turbo-release-${{ runner.os }}-
- run: npx turbo run _compile _schema
- name: Record pre-release version
id: pre
run: echo "version=$(npm pkg get version | tr -d '\"')" >> "$GITHUB_OUTPUT"
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to npm via OIDC
run: |
CURRENT=$(npm pkg get version | tr -d '"')
if [ "$CURRENT" != "${{ steps.pre.outputs.version }}" ]; then
echo "Publishing $CURRENT to npm..."
npm publish --provenance --access public
else
echo "No new version — skipping npm publish"
fi