@unisphere/nx 5.0.1 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/migrations/5-0-2/templates/_publish-artifacts.template +360 -0
- package/dist/migrations/5-0-2/update-publish-artifacts-workflow.d.ts +8 -0
- package/dist/migrations/5-0-2/update-publish-artifacts-workflow.d.ts.map +1 -0
- package/dist/migrations/5-0-2/update-publish-artifacts-workflow.js +40 -0
- package/migrations.json +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
name: Shared Deployment Jobs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
check-elements:
|
|
8
|
+
runs-on:
|
|
9
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.run_attempt }}
|
|
10
|
+
- instance-size:small
|
|
11
|
+
outputs:
|
|
12
|
+
has_packages: ${{ steps.check.outputs.has_packages }}
|
|
13
|
+
has_runtimes: ${{ steps.check.outputs.has_runtimes }}
|
|
14
|
+
has_applications: ${{ steps.check.outputs.has_applications }}
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout Repo
|
|
17
|
+
uses: actions/checkout@v5
|
|
18
|
+
with:
|
|
19
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
20
|
+
fetch-tags: true
|
|
21
|
+
|
|
22
|
+
- name: Check elements in .unisphere
|
|
23
|
+
id: check
|
|
24
|
+
run: |
|
|
25
|
+
if [ -f .unisphere ]; then
|
|
26
|
+
PACKAGES=$(jq -r '.elements.packages // {} | length' .unisphere)
|
|
27
|
+
RUNTIMES=$(jq -r '(.elements.runtimes // {} | length) + (.elements.workspace // {} | length) + (.elements.loader // {} | length)' .unisphere)
|
|
28
|
+
APPLICATIONS=$(jq -r '.elements.applications // {} | length' .unisphere)
|
|
29
|
+
|
|
30
|
+
if [ "$PACKAGES" -gt 0 ]; then
|
|
31
|
+
echo "has_packages=true" >> $GITHUB_OUTPUT
|
|
32
|
+
else
|
|
33
|
+
echo "has_packages=false" >> $GITHUB_OUTPUT
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
if [ "$RUNTIMES" -gt 0 ]; then
|
|
37
|
+
echo "has_runtimes=true" >> $GITHUB_OUTPUT
|
|
38
|
+
else
|
|
39
|
+
echo "has_runtimes=false" >> $GITHUB_OUTPUT
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
if [ "$APPLICATIONS" -gt 0 ]; then
|
|
43
|
+
echo "has_applications=true" >> $GITHUB_OUTPUT
|
|
44
|
+
else
|
|
45
|
+
echo "has_applications=false" >> $GITHUB_OUTPUT
|
|
46
|
+
fi
|
|
47
|
+
else
|
|
48
|
+
echo "has_packages=false" >> $GITHUB_OUTPUT
|
|
49
|
+
echo "has_runtimes=false" >> $GITHUB_OUTPUT
|
|
50
|
+
echo "has_applications=false" >> $GITHUB_OUTPUT
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
prepare-runtimes:
|
|
54
|
+
runs-on:
|
|
55
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.run_attempt }}
|
|
56
|
+
- instance-size:medium
|
|
57
|
+
|
|
58
|
+
if: needs.check-elements.outputs.has_runtimes == 'true'
|
|
59
|
+
needs: check-elements
|
|
60
|
+
outputs:
|
|
61
|
+
unisphereElementsArtifactsFolder: ${{ steps.prepare-runtimes.outputs.artifactsRootFolder }}
|
|
62
|
+
hasArtifacts: ${{ steps.prepare-runtimes.outputs.hasArtifacts }}
|
|
63
|
+
commit_sha: ${{ steps.capture_commit_sha.outputs.commit_sha }}
|
|
64
|
+
steps:
|
|
65
|
+
- name: Cache npm
|
|
66
|
+
uses: actions/cache@v5
|
|
67
|
+
with:
|
|
68
|
+
path: ~/.npm
|
|
69
|
+
key: dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-${{ hashFiles('package-lock.json') }}
|
|
70
|
+
restore-keys: |
|
|
71
|
+
dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-
|
|
72
|
+
|
|
73
|
+
- name: Checkout Repo
|
|
74
|
+
uses: actions/checkout@v5
|
|
75
|
+
with:
|
|
76
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
77
|
+
fetch-tags: true
|
|
78
|
+
- name: Setup Node.js
|
|
79
|
+
uses: actions/setup-node@v5
|
|
80
|
+
with:
|
|
81
|
+
node-version-file: ".nvmrc"
|
|
82
|
+
- name: Clean workspace
|
|
83
|
+
run: git reset --hard HEAD
|
|
84
|
+
- name: Clean npm cache
|
|
85
|
+
run: npm cache clean --force
|
|
86
|
+
|
|
87
|
+
- name: Setup JFrog
|
|
88
|
+
|
|
89
|
+
uses: jfrog/setup-jfrog-cli@v5
|
|
90
|
+
id: setup-jfrog
|
|
91
|
+
env:
|
|
92
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
93
|
+
with:
|
|
94
|
+
oidc-provider-name: ovp-github-oidc
|
|
95
|
+
- name: Install dependencies
|
|
96
|
+
run: npm ci --prefer-offline --include=optional --no-fund --verbose
|
|
97
|
+
env:
|
|
98
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
99
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
100
|
+
|
|
101
|
+
- name: Prepare Unisphere Elements
|
|
102
|
+
id: prepare-runtimes
|
|
103
|
+
run: npx unisphere runtime publish prepare --verbose
|
|
104
|
+
- name: Capture Commit SHA
|
|
105
|
+
id: capture_commit_sha
|
|
106
|
+
run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
|
107
|
+
- name: Set commit_sha as output
|
|
108
|
+
id: set_commit_sha
|
|
109
|
+
run: echo "commit_sha=${{ env.commit_sha }}" >> $GITHUB_OUTPUT
|
|
110
|
+
- uses: actions/upload-artifact@v6
|
|
111
|
+
id: upload-unisphere-elements-artifacts
|
|
112
|
+
with:
|
|
113
|
+
name: unisphere-elements
|
|
114
|
+
path: ${{ steps.prepare-runtimes.outputs.artifactsRootFolder }}
|
|
115
|
+
retention-days: 1
|
|
116
|
+
|
|
117
|
+
deploy-packages:
|
|
118
|
+
if: needs.check-elements.outputs.has_packages == 'true'
|
|
119
|
+
needs: check-elements
|
|
120
|
+
runs-on:
|
|
121
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.run_attempt }}
|
|
122
|
+
- instance-size:medium
|
|
123
|
+
steps:
|
|
124
|
+
- name: Cache npm
|
|
125
|
+
uses: actions/cache@v5
|
|
126
|
+
with:
|
|
127
|
+
path: ~/.npm
|
|
128
|
+
key: dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-${{ hashFiles('package-lock.json') }}
|
|
129
|
+
restore-keys: |
|
|
130
|
+
dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-
|
|
131
|
+
|
|
132
|
+
- name: Checkout Repo
|
|
133
|
+
uses: actions/checkout@v5
|
|
134
|
+
with:
|
|
135
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
136
|
+
fetch-tags: true
|
|
137
|
+
- name: Setup Node.js
|
|
138
|
+
uses: actions/setup-node@v5
|
|
139
|
+
with:
|
|
140
|
+
node-version-file: ".nvmrc"
|
|
141
|
+
|
|
142
|
+
- name: Setup JFrog
|
|
143
|
+
|
|
144
|
+
uses: jfrog/setup-jfrog-cli@v5
|
|
145
|
+
id: setup-jfrog
|
|
146
|
+
env:
|
|
147
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
148
|
+
with:
|
|
149
|
+
oidc-provider-name: ovp-github-oidc
|
|
150
|
+
|
|
151
|
+
- name: Install dependencies
|
|
152
|
+
|
|
153
|
+
run: |
|
|
154
|
+
npm ci --prefer-offline --include=optional --no-fund --verbose
|
|
155
|
+
|
|
156
|
+
env:
|
|
157
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
158
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
159
|
+
|
|
160
|
+
- name: Get NPM Token from AWS Secrets Manager
|
|
161
|
+
id: get-npm-token
|
|
162
|
+
run: |
|
|
163
|
+
NPM_TOKEN=$(aws secretsmanager get-secret-value --secret-id arn:aws:secretsmanager:eu-central-1:785328604905:secret:unisphere-secrets-um86Cs --query SecretString --output text | jq -r '."NPM_UNISPHERE_TOKEN"')
|
|
164
|
+
echo "NPM_TOKEN=$NPM_TOKEN" >> $GITHUB_ENV
|
|
165
|
+
# Debug token existence (safely)
|
|
166
|
+
echo "::debug::Token exists: $([ ! -z "$NPM_TOKEN" ] && echo 'true' || echo 'false')"
|
|
167
|
+
- name: Deploy to registry
|
|
168
|
+
run: npx unisphere package publish --verbose --jfrogToken ${{ steps.setup-jfrog.outputs.oidc-token }} --jfrogUser ${{ steps.setup-jfrog.outputs.oidc-user }} --npmToken ${{ env.NPM_TOKEN }} --branch "${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}"
|
|
169
|
+
|
|
170
|
+
deploy-runtimes:
|
|
171
|
+
if: needs.prepare-runtimes.outputs.hasArtifacts == 'true'
|
|
172
|
+
needs: prepare-runtimes
|
|
173
|
+
runs-on:
|
|
174
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.run_attempt }}
|
|
175
|
+
- instance-size:medium
|
|
176
|
+
strategy:
|
|
177
|
+
matrix:
|
|
178
|
+
envs_regions:
|
|
179
|
+
- { env: "nvp1", region: "us-east-1", accountid: "583352821080" }
|
|
180
|
+
- { env: "frp2", region: "eu-central-1", accountid: "082111255551" }
|
|
181
|
+
- { env: "irp2", region: "eu-west-1", accountid: "137576761235" }
|
|
182
|
+
- { env: "nvq2", region: "us-east-1", accountid: "383697330906" }
|
|
183
|
+
- { env: "syp2", region: "ap-southeast-2", accountid: "650755435642" }
|
|
184
|
+
- { env: "cap2", region: "ca-central-1", accountid: "948632009361" }
|
|
185
|
+
fail-fast: false
|
|
186
|
+
|
|
187
|
+
steps:
|
|
188
|
+
- name: Cache npm
|
|
189
|
+
uses: actions/cache@v5
|
|
190
|
+
with:
|
|
191
|
+
path: ~/.npm
|
|
192
|
+
key: dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-${{ hashFiles('package-lock.json') }}
|
|
193
|
+
restore-keys: |
|
|
194
|
+
dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-
|
|
195
|
+
|
|
196
|
+
- name: Check available disk space
|
|
197
|
+
run: df -h
|
|
198
|
+
- name: Checkout Repo at specific commit
|
|
199
|
+
uses: actions/checkout@v5
|
|
200
|
+
with:
|
|
201
|
+
ref: ${{ needs.prepare-runtimes.outputs.commit_sha }}
|
|
202
|
+
fetch-tags: true
|
|
203
|
+
- name: Setup Node.js
|
|
204
|
+
uses: actions/setup-node@v5
|
|
205
|
+
with:
|
|
206
|
+
node-version-file: ".nvmrc"
|
|
207
|
+
|
|
208
|
+
- name: Setup JFrog
|
|
209
|
+
|
|
210
|
+
uses: jfrog/setup-jfrog-cli@v5
|
|
211
|
+
id: setup-jfrog
|
|
212
|
+
env:
|
|
213
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
214
|
+
with:
|
|
215
|
+
oidc-provider-name: ovp-github-oidc
|
|
216
|
+
|
|
217
|
+
- name: Install dependencies
|
|
218
|
+
|
|
219
|
+
run: npm ci --prefer-offline --include=optional --no-fund --verbose
|
|
220
|
+
env:
|
|
221
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
222
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
223
|
+
|
|
224
|
+
- name: Download artifacts folder
|
|
225
|
+
uses: actions/download-artifact@v7
|
|
226
|
+
with:
|
|
227
|
+
name: unisphere-elements
|
|
228
|
+
path: ${{ needs.prepare-runtimes.outputs.unisphereElementsArtifactsFolder }}
|
|
229
|
+
- name: Sync S3 bucket
|
|
230
|
+
run: |
|
|
231
|
+
npx unisphere runtime publish execute \
|
|
232
|
+
--env ${{ matrix.envs_regions.env }} \
|
|
233
|
+
--aws-region '${{ matrix.envs_regions.region }}' \
|
|
234
|
+
--aws-arn 'arn:aws:iam::${{matrix.envs_regions.accountid }}:role/${{ matrix.envs_regions.env }}-unisphere-content-role' \
|
|
235
|
+
--artifacts-folder '${{ needs.prepare-runtimes.outputs.unisphereElementsArtifactsFolder }}' \
|
|
236
|
+
--verbose
|
|
237
|
+
|
|
238
|
+
prepare-applications:
|
|
239
|
+
if: always() && needs.check-elements.outputs.has_applications == 'true'
|
|
240
|
+
needs: [deploy-runtimes, check-elements]
|
|
241
|
+
runs-on:
|
|
242
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.run_attempt }}
|
|
243
|
+
- instance-size:medium
|
|
244
|
+
outputs:
|
|
245
|
+
unisphereApplicationsArtifactsFolder: ${{ steps.prepare-applications.outputs.artifactsRootFolder }}
|
|
246
|
+
hasArtifacts: ${{ steps.prepare-applications.outputs.hasArtifacts }}
|
|
247
|
+
commit_sha: ${{ steps.capture_commit_sha.outputs.commit_sha }}
|
|
248
|
+
steps:
|
|
249
|
+
- name: Cache npm
|
|
250
|
+
uses: actions/cache@v5
|
|
251
|
+
with:
|
|
252
|
+
path: ~/.npm
|
|
253
|
+
key: dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-${{ hashFiles('package-lock.json') }}
|
|
254
|
+
restore-keys: |
|
|
255
|
+
dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-
|
|
256
|
+
|
|
257
|
+
- name: Checkout Repo
|
|
258
|
+
uses: actions/checkout@v5
|
|
259
|
+
with:
|
|
260
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
261
|
+
fetch-tags: true
|
|
262
|
+
- name: Setup Node.js
|
|
263
|
+
uses: actions/setup-node@v5
|
|
264
|
+
with:
|
|
265
|
+
node-version-file: ".nvmrc"
|
|
266
|
+
- name: Clean workspace
|
|
267
|
+
run: git reset --hard HEAD
|
|
268
|
+
- name: Clean npm cache
|
|
269
|
+
run: npm cache clean --force
|
|
270
|
+
- name: Setup JFrog
|
|
271
|
+
|
|
272
|
+
uses: jfrog/setup-jfrog-cli@v5
|
|
273
|
+
id: setup-jfrog
|
|
274
|
+
env:
|
|
275
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
276
|
+
with:
|
|
277
|
+
oidc-provider-name: ovp-github-oidc
|
|
278
|
+
- name: Install dependencies
|
|
279
|
+
|
|
280
|
+
run: npm ci --prefer-offline --include=optional --no-fund --verbose
|
|
281
|
+
env:
|
|
282
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
283
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
284
|
+
- name: Prepare Unisphere Applications
|
|
285
|
+
id: prepare-applications
|
|
286
|
+
run: npx unisphere application publish prepare --verbose
|
|
287
|
+
- name: Capture Commit SHA
|
|
288
|
+
id: capture_commit_sha
|
|
289
|
+
run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
|
290
|
+
- name: Set commit_sha as output
|
|
291
|
+
id: set_commit_sha
|
|
292
|
+
run: echo "commit_sha=${{ env.commit_sha }}" >> $GITHUB_OUTPUT
|
|
293
|
+
- uses: actions/upload-artifact@v6
|
|
294
|
+
id: upload-unisphere-applications-artifacts
|
|
295
|
+
with:
|
|
296
|
+
name: unisphere-applications
|
|
297
|
+
path: ${{ steps.prepare-applications.outputs.artifactsRootFolder }}
|
|
298
|
+
retention-days: 1
|
|
299
|
+
|
|
300
|
+
deploy-applications:
|
|
301
|
+
if: always() && needs.prepare-applications.outputs.hasArtifacts == 'true'
|
|
302
|
+
needs: [prepare-applications]
|
|
303
|
+
runs-on:
|
|
304
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.run_attempt }}
|
|
305
|
+
- instance-size:medium
|
|
306
|
+
strategy:
|
|
307
|
+
matrix:
|
|
308
|
+
envs_regions:
|
|
309
|
+
- { env: "nvp1", region: "us-east-1", accountid: "583352821080" }
|
|
310
|
+
- { env: "frp2", region: "eu-central-1", accountid: "082111255551" }
|
|
311
|
+
- { env: "irp2", region: "eu-west-1", accountid: "137576761235" }
|
|
312
|
+
- { env: "nvq2", region: "us-east-1", accountid: "383697330906" }
|
|
313
|
+
- { env: "syp2", region: "ap-southeast-2", accountid: "650755435642" }
|
|
314
|
+
- { env: "cap2", region: "ca-central-1", accountid: "948632009361" }
|
|
315
|
+
fail-fast: false
|
|
316
|
+
steps:
|
|
317
|
+
- name: Cache npm
|
|
318
|
+
uses: actions/cache@v5
|
|
319
|
+
with:
|
|
320
|
+
path: ~/.npm
|
|
321
|
+
key: dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-${{ hashFiles('package-lock.json') }}
|
|
322
|
+
restore-keys: |
|
|
323
|
+
dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-
|
|
324
|
+
|
|
325
|
+
- name: Checkout Repo at specific commit
|
|
326
|
+
uses: actions/checkout@v5
|
|
327
|
+
with:
|
|
328
|
+
ref: ${{ needs.prepare-applications.outputs.commit_sha }}
|
|
329
|
+
fetch-tags: true
|
|
330
|
+
- name: Setup Node.js
|
|
331
|
+
uses: actions/setup-node@v5
|
|
332
|
+
with:
|
|
333
|
+
node-version-file: ".nvmrc"
|
|
334
|
+
- name: Setup JFrog
|
|
335
|
+
|
|
336
|
+
uses: jfrog/setup-jfrog-cli@v5
|
|
337
|
+
id: setup-jfrog
|
|
338
|
+
env:
|
|
339
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
340
|
+
with:
|
|
341
|
+
oidc-provider-name: ovp-github-oidc
|
|
342
|
+
- name: Install dependencies
|
|
343
|
+
|
|
344
|
+
run: npm ci --prefer-offline --include=optional --no-fund --verbose
|
|
345
|
+
env:
|
|
346
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
347
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
348
|
+
- name: Download artifacts folder
|
|
349
|
+
uses: actions/download-artifact@v7
|
|
350
|
+
with:
|
|
351
|
+
name: unisphere-applications
|
|
352
|
+
path: ${{ needs.prepare-applications.outputs.unisphereApplicationsArtifactsFolder }}
|
|
353
|
+
- name: Sync S3 bucket
|
|
354
|
+
run: |
|
|
355
|
+
npx unisphere application publish execute \
|
|
356
|
+
--env ${{ matrix.envs_regions.env }} \
|
|
357
|
+
--aws-region '${{ matrix.envs_regions.region }}' \
|
|
358
|
+
--aws-arn 'arn:aws:iam::${{matrix.envs_regions.accountid }}:role/${{ matrix.envs_regions.env }}-unisphere-content-role' \
|
|
359
|
+
--artifacts-folder '${{ needs.prepare-applications.outputs.unisphereApplicationsArtifactsFolder }}' \
|
|
360
|
+
--verbose
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration: Update _publish-artifacts.yml workflow
|
|
3
|
+
*
|
|
4
|
+
* Replaces .github/workflows/_publish-artifacts.yml with updated version.
|
|
5
|
+
*/
|
|
6
|
+
import { Tree } from '@nx/devkit';
|
|
7
|
+
export default function update(tree: Tree): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=update-publish-artifacts-workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-publish-artifacts-workflow.d.ts","sourceRoot":"","sources":["../../../src/migrations/5-0-2/update-publish-artifacts-workflow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAI1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAuC9D"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Migration: Update _publish-artifacts.yml workflow
|
|
4
|
+
*
|
|
5
|
+
* Replaces .github/workflows/_publish-artifacts.yml with updated version.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.default = update;
|
|
9
|
+
const devkit_1 = require("@nx/devkit");
|
|
10
|
+
const fs_1 = require("fs");
|
|
11
|
+
const path_1 = require("path");
|
|
12
|
+
async function update(tree) {
|
|
13
|
+
devkit_1.logger.info('🔄 Updating GitHub _publish-artifacts workflow for v5.0.2');
|
|
14
|
+
// Ensure .github/workflows directory exists
|
|
15
|
+
if (!tree.exists('.github')) {
|
|
16
|
+
tree.write('.github/.gitkeep', '');
|
|
17
|
+
devkit_1.logger.info('✅ Created .github directory');
|
|
18
|
+
}
|
|
19
|
+
if (!tree.exists('.github/workflows')) {
|
|
20
|
+
tree.write('.github/workflows/.gitkeep', '');
|
|
21
|
+
devkit_1.logger.info('✅ Created .github/workflows directory');
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
const workflowPath = '.github/workflows/_publish-artifacts.yml';
|
|
25
|
+
const templatePath = (0, path_1.join)(__dirname, 'templates', '_publish-artifacts.template');
|
|
26
|
+
const templateContent = (0, fs_1.readFileSync)(templatePath, 'utf-8');
|
|
27
|
+
const workflowExists = tree.exists(workflowPath);
|
|
28
|
+
tree.write(workflowPath, templateContent);
|
|
29
|
+
if (workflowExists) {
|
|
30
|
+
devkit_1.logger.info(`✅ Updated ${workflowPath}`);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
devkit_1.logger.info(`✅ Created ${workflowPath}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
devkit_1.logger.error(`❌ Failed to update GitHub _publish-artifacts workflow: ${error?.message || 'Unknown error'}`);
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
}
|
package/migrations.json
CHANGED
|
@@ -642,6 +642,14 @@
|
|
|
642
642
|
"cli": {
|
|
643
643
|
"postUpdateMessage": "✅ Documentation support removed"
|
|
644
644
|
}
|
|
645
|
+
},
|
|
646
|
+
"5-0-2-update-publish-artifacts-workflow": {
|
|
647
|
+
"version": "5.0.2",
|
|
648
|
+
"description": "Updates .github/workflows/_publish-artifacts.yml with latest template",
|
|
649
|
+
"factory": "./dist/migrations/5-0-2/update-publish-artifacts-workflow.js",
|
|
650
|
+
"cli": {
|
|
651
|
+
"postUpdateMessage": "✅ .github/workflows/_publish-artifacts.yml updated successfully"
|
|
652
|
+
}
|
|
645
653
|
}
|
|
646
654
|
},
|
|
647
655
|
"packageJsonUpdates": {
|