-
Notifications
You must be signed in to change notification settings - Fork 1
137 lines (113 loc) · 3.65 KB
/
validate.yml
File metadata and controls
137 lines (113 loc) · 3.65 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Validate
on:
pull_request:
push:
branches:
- master
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.8
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: Run Tests
run: bun run test
- name: Type Check
run: bun run typecheck
- name: Validate Shader Manifests
run: bun run validate:shaders
- name: Build Registry
run: bun run build:registry
- name: Upload Registry Artifact
uses: actions/upload-artifact@v4
with:
name: registry
path: dist/registry/
deploy-registry:
needs: check
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.8
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: Build Registry
run: bun run build:registry
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: pages deploy dist/registry --project-name=shaderbase-registry
# Web app deployment is pending — SolidJS + TanStack Start + Cloudflare Workers
# has a known bundling issue (ssrStyleProperty not exported in worker mode).
# Tracking: https://github.com/TanStack/router/issues/5291
# Options: Railway (Node.js), or wait for Cloudflare Vite plugin SolidJS support.
# deploy-web:
# needs: [check, deploy-registry]
# if: github.ref == 'refs/heads/master' && github.event_name == 'push'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: oven-sh/setup-bun@v2
# with:
# bun-version: 1.3.8
# - run: bun install --frozen-lockfile
# - run: cd apps/web && bun install --frozen-lockfile && bun run build
# # Deploy to Railway or Fly.io when ready
publish-cli:
needs: check
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
environment:
name: npm
url: https://www.npmjs.com/package/@shaderbase/cli
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.8
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: Upgrade npm (trusted publishing requires >= 11.5.1)
run: npm install -g npm@latest
- name: Build CLI
run: cd packages/cli && bun run build
- name: Publish to npm (if version changed)
run: |
cd packages/cli
CURRENT=$(npm view @shaderbase/cli version 2>/dev/null || echo "0.0.0")
LOCAL=$(node -p "require('./package.json').version")
if [ "$CURRENT" != "$LOCAL" ]; then
npm publish --access public --provenance
else
echo "Version $LOCAL already published, skipping."
fi