-
Notifications
You must be signed in to change notification settings - Fork 45
254 lines (235 loc) · 12.4 KB
/
publish.yml
File metadata and controls
254 lines (235 loc) · 12.4 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
name: 01 - Publish
env:
prefix: # 'v4-', when v5 is released
on:
workflow_dispatch:
inputs:
increment:
type: boolean
description: 'Would you like to set the version before publishing? (Else: The current version from the code repository will be used.)'
default: true
tag:
type: choice
description: Which NPM tag should be assigned?
options:
- dev
- next
- latest
version: # see https://github.com/lerna/lerna/tree/main/libs/commands/version#semver-bump
type: choice
description: SemVer keyword for version bump
options:
- prerelease
- prepatch
- patch
- preminor
- minor
label: # see https://github.com/lerna/lerna/tree/main/libs/commands/version#--preid
type: choice
description: SemVer pre release label (optional)
options:
- rc
- beta
- alpha
permissions:
contents: read
id-token: write
jobs:
publish:
if: github.repository == 'public-ui/kolibri'
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- uses: actions/checkout@v6
with:
token: ${{ steps.app-token.outputs.token }}
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 22
registry-url: https://registry.npmjs.org
- name: Install pnpm
uses: pnpm/action-setup@v4
id: pnpm-install
with:
version: 10
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v5
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store
restore-keys: |
${{ runner.os }}-pnpm-store
- name: Install
run: pnpm i --frozen-lockfile
- name: Configure Git user
run: |
git config --local user.email "${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com"
git config --local user.name "${{ steps.app-token.outputs.app-slug }}[bot]"
- name: Bump versions without dev-tag and with git push
if: github.event.inputs.increment == 'true' && github.event.inputs.tag != 'dev'
run: 'HUSKY=0 npx lerna version ${{github.event.inputs.version}} --preid=${{github.event.inputs.label}} --no-private --tag-version-prefix="" -m "chore: release %v" -y --force-publish'
- name: Bump versions with dev-tag and without git push
if: github.event.inputs.increment == 'true' && github.event.inputs.tag == 'dev'
run: 'HUSKY=0 npx lerna version prerelease --preid=$GITHUB_SHA --no-private --tag-version-prefix="" -m "chore: release %v" -y --force-publish --no-push'
- name: Build
run: pnpm -r build
- name: Build and publish components
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/components
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish adapter angular v19
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/adapters/angular/v19
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish adapter angular v20
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/adapters/angular/v20
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish adapter angular v21
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/adapters/angular/v21
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish adapter react
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/adapters/react
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish adapter react-v19
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/adapters/react-v19
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish adapter react-standalone
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/adapters/react-standalone
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish adapter solid
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/adapters/solid
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish adapter svelte
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/adapters/svelte
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish adapter vue
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/adapters/vue
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish adapter preact
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/adapters/preact
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish adapter hydrate
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/adapters/hydrate
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish adapter react hook form
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/adapters/react-hook-form-adapter
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish tools kolibri-cli
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/tools/kolibri-cli
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish tools mcp
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/tools/mcp
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish theme default
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/themes/default
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish theme ecl
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/themes/ecl
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish theme kern
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/themes/kern
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish themes
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/themes
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish sample react
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/samples/react
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- name: Build and publish tools visual-tests
run: pnpm publish --access public --provenance --no-git-checks --tag ${{env.prefix}}${{github.event.inputs.tag}} || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/tools/visual-tests
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}}
NPM_CONFIG_PROVENANCE: true
- uses: actions/setup-node@v6
with:
node-version: 22
registry-url: https://npm.pkg.github.com
- name: Publish sample react
run: npm publish --access restricted || echo "⚠️ Publish skipped – package already exists"
working-directory: packages/samples/react
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Manage version tags for Netlify deployments
- name: Update version tag for stable deployments
if: github.event.inputs.tag == 'latest'
run: |
VERSION_TAG="${{env.prefix}}${{github.event.inputs.tag}}"
echo "Updating version tag: $VERSION_TAG"
git tag -d "$VERSION_TAG" 2>/dev/null || true
git push origin ":refs/tags/$VERSION_TAG" 2>/dev/null || true
git tag -a "$VERSION_TAG" -m "Update $VERSION_TAG to $(git describe --tags --abbrev=0)"
git push origin "$VERSION_TAG"
echo "Successfully updated tag $VERSION_TAG"