@unisphere/nx 2.1.0 → 2.2.0
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/generators/add-package/README.md +3 -3
- package/dist/migrations/1-22-0/check-nx-version.js +1 -1
- package/dist/migrations/1-22-0/replace-patches.d.ts.map +1 -1
- package/dist/migrations/1-22-0/replace-patches.js +1 -2
- package/dist/migrations/1-22-2/templates/cicd.template +1 -1
- package/dist/migrations/1-22-4/summary.d.ts.map +1 -1
- package/dist/migrations/1-22-4/summary.js +7 -2
- package/dist/migrations/{2-0-0/replace-patches.d.ts → 1-22-7/remove-storybook.d.ts} +1 -1
- package/dist/migrations/1-22-7/remove-storybook.d.ts.map +1 -0
- package/dist/migrations/1-22-7/remove-storybook.js +114 -0
- package/dist/migrations/1-22-7/update-git-ignore.d.ts +3 -0
- package/dist/migrations/1-22-7/update-git-ignore.d.ts.map +1 -0
- package/dist/migrations/1-22-7/update-git-ignore.js +55 -0
- package/dist/migrations/1-22-9/fix-prerelease-deploy.d.ts +3 -0
- package/dist/migrations/1-22-9/fix-prerelease-deploy.d.ts.map +1 -0
- package/dist/migrations/1-22-9/fix-prerelease-deploy.js +27 -0
- package/dist/migrations/1-22-9/templates/cicd.template +79 -0
- package/dist/migrations/1-23-0/delete-rollup-patch.d.ts +3 -0
- package/dist/migrations/1-23-0/delete-rollup-patch.d.ts.map +1 -0
- package/dist/migrations/1-23-0/delete-rollup-patch.js +14 -0
- package/dist/migrations/1-23-2/update-nvmrc.d.ts.map +1 -0
- package/dist/migrations/1-24-2/force-always-for-applications.d.ts +3 -0
- package/dist/migrations/1-24-2/force-always-for-applications.d.ts.map +1 -0
- package/dist/migrations/1-24-2/force-always-for-applications.js +36 -0
- package/dist/migrations/1-24-2/templates/_publish-artifacts.template +306 -0
- package/dist/migrations/2-0-0/summary.d.ts.map +1 -1
- package/dist/migrations/2-0-0/summary.js +7 -2
- package/dist/migrations/2-2-0/replace-github-workflow.d.ts +3 -0
- package/dist/migrations/2-2-0/replace-github-workflow.d.ts.map +1 -0
- package/dist/migrations/2-2-0/replace-github-workflow.js +36 -0
- package/dist/migrations/2-2-0/templates/_publish-artifacts.template +309 -0
- package/dist/migrations/utils/open.d.ts +2 -0
- package/dist/migrations/utils/open.d.ts.map +1 -0
- package/dist/migrations/utils/open.js +16 -0
- package/migrations.json +66 -17
- package/package.json +2 -2
- package/dist/migrations/1-22-0/patches/@nx+rollup+22.1.3.patch +0 -27
- package/dist/migrations/2-0-0/patches/@nx+rollup+22.1.3.patch +0 -27
- package/dist/migrations/2-0-0/replace-patches.d.ts.map +0 -1
- package/dist/migrations/2-0-0/replace-patches.js +0 -56
- package/dist/migrations/2-0-0/update-nvmrc.d.ts.map +0 -1
- /package/dist/migrations/{2-0-0 → 1-23-2}/update-nvmrc.d.ts +0 -0
- /package/dist/migrations/{2-0-0 → 1-23-2}/update-nvmrc.js +0 -0
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
name: Shared Deployment Jobs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
check-elements:
|
|
8
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
9
|
+
outputs:
|
|
10
|
+
has_packages: ${{ steps.check.outputs.has_packages }}
|
|
11
|
+
has_runtimes: ${{ steps.check.outputs.has_runtimes }}
|
|
12
|
+
has_applications: ${{ steps.check.outputs.has_applications }}
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout Repo
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
18
|
+
fetch-tags: true
|
|
19
|
+
|
|
20
|
+
- name: Check elements in .unisphere
|
|
21
|
+
id: check
|
|
22
|
+
run: |
|
|
23
|
+
if [ -f .unisphere ]; then
|
|
24
|
+
PACKAGES=$(jq -r '.elements.packages // {} | length' .unisphere)
|
|
25
|
+
RUNTIMES=$(jq -r '(.elements.runtimes // {} | length) + (.elements.workspace // {} | length) + (.elements.loader // {} | length)' .unisphere)
|
|
26
|
+
APPLICATIONS=$(jq -r '.elements.applications // {} | length' .unisphere)
|
|
27
|
+
|
|
28
|
+
if [ "$PACKAGES" -gt 0 ]; then
|
|
29
|
+
echo "has_packages=true" >> $GITHUB_OUTPUT
|
|
30
|
+
else
|
|
31
|
+
echo "has_packages=false" >> $GITHUB_OUTPUT
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
if [ "$RUNTIMES" -gt 0 ]; then
|
|
35
|
+
echo "has_runtimes=true" >> $GITHUB_OUTPUT
|
|
36
|
+
else
|
|
37
|
+
echo "has_runtimes=false" >> $GITHUB_OUTPUT
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
if [ "$APPLICATIONS" -gt 0 ]; then
|
|
41
|
+
echo "has_applications=true" >> $GITHUB_OUTPUT
|
|
42
|
+
else
|
|
43
|
+
echo "has_applications=false" >> $GITHUB_OUTPUT
|
|
44
|
+
fi
|
|
45
|
+
else
|
|
46
|
+
echo "has_packages=false" >> $GITHUB_OUTPUT
|
|
47
|
+
echo "has_runtimes=false" >> $GITHUB_OUTPUT
|
|
48
|
+
echo "has_applications=false" >> $GITHUB_OUTPUT
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
prepare-runtimes:
|
|
52
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
53
|
+
if: needs.check-elements.outputs.has_runtimes == 'true'
|
|
54
|
+
needs: check-elements
|
|
55
|
+
outputs:
|
|
56
|
+
unisphereElementsArtifactsFolder: ${{ steps.prepare-runtimes.outputs.artifactsRootFolder }}
|
|
57
|
+
hasArtifacts: ${{ steps.prepare-runtimes.outputs.hasArtifacts }}
|
|
58
|
+
commit_sha: ${{ steps.capture_commit_sha.outputs.commit_sha }}
|
|
59
|
+
steps:
|
|
60
|
+
- name: Checkout Repo
|
|
61
|
+
uses: actions/checkout@v4
|
|
62
|
+
with:
|
|
63
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
64
|
+
fetch-tags: true
|
|
65
|
+
- name: Setup Node.js
|
|
66
|
+
uses: actions/setup-node@v4
|
|
67
|
+
with:
|
|
68
|
+
node-version-file: '.nvmrc'
|
|
69
|
+
- name: Clean workspace
|
|
70
|
+
run: git reset --hard HEAD
|
|
71
|
+
- name: Clean npm cache
|
|
72
|
+
run: npm cache clean --force
|
|
73
|
+
|
|
74
|
+
- name: Setup JFrog
|
|
75
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
76
|
+
id: setup-jfrog
|
|
77
|
+
env:
|
|
78
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
79
|
+
with:
|
|
80
|
+
oidc-provider-name: ovp-github-oidc
|
|
81
|
+
|
|
82
|
+
- name: Install dependencies
|
|
83
|
+
run: npm ci --ignore-scripts
|
|
84
|
+
env:
|
|
85
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
86
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
87
|
+
|
|
88
|
+
- name: Prepare Unisphere Elements
|
|
89
|
+
id: prepare-runtimes
|
|
90
|
+
run: npx unisphere runtime publish prepare --verbose
|
|
91
|
+
- name: Capture Commit SHA
|
|
92
|
+
id: capture_commit_sha
|
|
93
|
+
run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
|
94
|
+
- name: Set commit_sha as output
|
|
95
|
+
id: set_commit_sha
|
|
96
|
+
run: echo "commit_sha=${{ env.commit_sha }}" >> $GITHUB_OUTPUT
|
|
97
|
+
- uses: actions/upload-artifact@v4
|
|
98
|
+
id: upload-unisphere-elements-artifacts
|
|
99
|
+
with:
|
|
100
|
+
name: unisphere-elements
|
|
101
|
+
path: ${{ steps.prepare-runtimes.outputs.artifactsRootFolder }}
|
|
102
|
+
retention-days: 1
|
|
103
|
+
|
|
104
|
+
deploy-packages:
|
|
105
|
+
if: needs.check-elements.outputs.has_packages == 'true'
|
|
106
|
+
needs: check-elements
|
|
107
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
108
|
+
steps:
|
|
109
|
+
- name: Checkout Repo
|
|
110
|
+
uses: actions/checkout@v4
|
|
111
|
+
with:
|
|
112
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
113
|
+
fetch-tags: true
|
|
114
|
+
- name: Setup Node.js
|
|
115
|
+
uses: actions/setup-node@v4
|
|
116
|
+
with:
|
|
117
|
+
node-version-file: '.nvmrc'
|
|
118
|
+
|
|
119
|
+
- name: Setup JFrog
|
|
120
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
121
|
+
id: setup-jfrog
|
|
122
|
+
env:
|
|
123
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
124
|
+
with:
|
|
125
|
+
oidc-provider-name: ovp-github-oidc
|
|
126
|
+
|
|
127
|
+
- name: Install dependencies
|
|
128
|
+
run: |
|
|
129
|
+
npm ci --ignore-scripts
|
|
130
|
+
|
|
131
|
+
env:
|
|
132
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
133
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
134
|
+
|
|
135
|
+
- name: Get NPM Token from AWS Secrets Manager
|
|
136
|
+
id: get-npm-token
|
|
137
|
+
run: |
|
|
138
|
+
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"')
|
|
139
|
+
echo "NPM_TOKEN=$NPM_TOKEN" >> $GITHUB_ENV
|
|
140
|
+
# Debug token existence (safely)
|
|
141
|
+
echo "::debug::Token exists: $([ ! -z "$NPM_TOKEN" ] && echo 'true' || echo 'false')"
|
|
142
|
+
- name: Deploy to registry
|
|
143
|
+
run: npx unisphere package publish --verbose --githubToken ${{ secrets.GITHUB_TOKEN }} --npmToken ${{ env.NPM_TOKEN }} --branch "${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}"
|
|
144
|
+
|
|
145
|
+
deploy-runtimes:
|
|
146
|
+
if: needs.prepare-runtimes.outputs.hasArtifacts == 'true'
|
|
147
|
+
needs: prepare-runtimes
|
|
148
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
149
|
+
strategy:
|
|
150
|
+
matrix:
|
|
151
|
+
envs_regions:
|
|
152
|
+
- { env: 'nvp1', region: 'us-east-1', accountid: '583352821080' }
|
|
153
|
+
- { env: 'frp2', region: 'eu-central-1', accountid: '082111255551' }
|
|
154
|
+
- { env: 'irp2', region: 'eu-west-1', accountid: '137576761235' }
|
|
155
|
+
- { env: 'nvq2', region: 'us-east-1', accountid: '383697330906' }
|
|
156
|
+
- { env: 'sgp2', region: 'ap-southeast-1', accountid: '882351240370' }
|
|
157
|
+
- { env: 'syp2', region: 'ap-southeast-2', accountid: '650755435642' }
|
|
158
|
+
- { env: 'cap2', region: 'ca-central-1', accountid: '948632009361' }
|
|
159
|
+
fail-fast: false
|
|
160
|
+
|
|
161
|
+
steps:
|
|
162
|
+
- name: Check available disk space
|
|
163
|
+
run: df -h
|
|
164
|
+
- name: Checkout Repo at specific commit
|
|
165
|
+
uses: actions/checkout@v4
|
|
166
|
+
with:
|
|
167
|
+
ref: ${{ needs.prepare-runtimes.outputs.commit_sha }}
|
|
168
|
+
fetch-tags: true
|
|
169
|
+
- name: Setup Node.js
|
|
170
|
+
uses: actions/setup-node@v4
|
|
171
|
+
with:
|
|
172
|
+
node-version-file: '.nvmrc'
|
|
173
|
+
|
|
174
|
+
- name: Setup JFrog
|
|
175
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
176
|
+
id: setup-jfrog
|
|
177
|
+
env:
|
|
178
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
179
|
+
with:
|
|
180
|
+
oidc-provider-name: ovp-github-oidc
|
|
181
|
+
|
|
182
|
+
- name: Install dependencies
|
|
183
|
+
run: |
|
|
184
|
+
npm ci --ignore-scripts
|
|
185
|
+
env:
|
|
186
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
187
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
188
|
+
|
|
189
|
+
- name: Download artifacts folder
|
|
190
|
+
uses: actions/download-artifact@v4
|
|
191
|
+
with:
|
|
192
|
+
name: unisphere-elements
|
|
193
|
+
path: ${{ needs.prepare-runtimes.outputs.unisphereElementsArtifactsFolder }}
|
|
194
|
+
- name: Sync S3 bucket
|
|
195
|
+
run: |
|
|
196
|
+
npx unisphere runtime publish execute \
|
|
197
|
+
--env ${{ matrix.envs_regions.env }} \
|
|
198
|
+
--aws-region '${{ matrix.envs_regions.region }}' \
|
|
199
|
+
--aws-arn 'arn:aws:iam::${{matrix.envs_regions.accountid }}:role/${{ matrix.envs_regions.env }}-unisphere-content-role' \
|
|
200
|
+
--artifacts-folder '${{ needs.prepare-runtimes.outputs.unisphereElementsArtifactsFolder }}' \
|
|
201
|
+
--verbose
|
|
202
|
+
|
|
203
|
+
prepare-applications:
|
|
204
|
+
if: always() && needs.check-elements.outputs.has_applications == 'true'
|
|
205
|
+
needs: [deploy-runtimes, check-elements]
|
|
206
|
+
runs-on:
|
|
207
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
208
|
+
- instance-size:medium
|
|
209
|
+
outputs:
|
|
210
|
+
unisphereApplicationsArtifactsFolder: ${{ steps.prepare-applications.outputs.artifactsRootFolder }}
|
|
211
|
+
hasArtifacts: ${{ steps.prepare-applications.outputs.hasArtifacts }}
|
|
212
|
+
commit_sha: ${{ steps.capture_commit_sha.outputs.commit_sha }}
|
|
213
|
+
steps:
|
|
214
|
+
- name: Checkout Repo
|
|
215
|
+
uses: actions/checkout@v4
|
|
216
|
+
with:
|
|
217
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
218
|
+
fetch-tags: true
|
|
219
|
+
- name: Setup Node.js
|
|
220
|
+
uses: actions/setup-node@v4
|
|
221
|
+
with:
|
|
222
|
+
node-version-file: '.nvmrc'
|
|
223
|
+
- name: Clean workspace
|
|
224
|
+
run: git reset --hard HEAD
|
|
225
|
+
- name: Clean npm cache
|
|
226
|
+
run: npm cache clean --force
|
|
227
|
+
- name: Setup JFrog
|
|
228
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
229
|
+
id: setup-jfrog
|
|
230
|
+
env:
|
|
231
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
232
|
+
with:
|
|
233
|
+
oidc-provider-name: ovp-github-oidc
|
|
234
|
+
- name: Install dependencies
|
|
235
|
+
run: npm ci --ignore-scripts
|
|
236
|
+
env:
|
|
237
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
238
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
239
|
+
- name: Prepare Unisphere Applications
|
|
240
|
+
id: prepare-applications
|
|
241
|
+
run: npx unisphere application publish prepare --verbose
|
|
242
|
+
- name: Capture Commit SHA
|
|
243
|
+
id: capture_commit_sha
|
|
244
|
+
run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
|
245
|
+
- name: Set commit_sha as output
|
|
246
|
+
id: set_commit_sha
|
|
247
|
+
run: echo "commit_sha=${{ env.commit_sha }}" >> $GITHUB_OUTPUT
|
|
248
|
+
- uses: actions/upload-artifact@v4
|
|
249
|
+
id: upload-unisphere-applications-artifacts
|
|
250
|
+
with:
|
|
251
|
+
name: unisphere-applications
|
|
252
|
+
path: ${{ steps.prepare-applications.outputs.artifactsRootFolder }}
|
|
253
|
+
retention-days: 1
|
|
254
|
+
|
|
255
|
+
deploy-applications:
|
|
256
|
+
if: always() && needs.prepare-applications.outputs.hasArtifacts == 'true'
|
|
257
|
+
needs: [prepare-applications]
|
|
258
|
+
runs-on:
|
|
259
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
260
|
+
- instance-size:medium
|
|
261
|
+
strategy:
|
|
262
|
+
matrix:
|
|
263
|
+
envs_regions:
|
|
264
|
+
- { env: 'nvp1', region: 'us-east-1', accountid: '583352821080' }
|
|
265
|
+
- { env: 'frp2', region: 'eu-central-1', accountid: '082111255551' }
|
|
266
|
+
- { env: 'irp2', region: 'eu-west-1', accountid: '137576761235' }
|
|
267
|
+
- { env: 'nvq2', region: 'us-east-1', accountid: '383697330906' }
|
|
268
|
+
- { env: 'sgp2', region: 'ap-southeast-1', accountid: '882351240370' }
|
|
269
|
+
- { env: 'syp2', region: 'ap-southeast-2', accountid: '650755435642' }
|
|
270
|
+
- { env: 'cap2', region: 'ca-central-1', accountid: '948632009361' }
|
|
271
|
+
fail-fast: false
|
|
272
|
+
steps:
|
|
273
|
+
- name: Checkout Repo at specific commit
|
|
274
|
+
uses: actions/checkout@v4
|
|
275
|
+
with:
|
|
276
|
+
ref: ${{ needs.prepare-applications.outputs.commit_sha }}
|
|
277
|
+
fetch-tags: true
|
|
278
|
+
- name: Setup Node.js
|
|
279
|
+
uses: actions/setup-node@v4
|
|
280
|
+
with:
|
|
281
|
+
node-version-file: '.nvmrc'
|
|
282
|
+
- name: Setup JFrog
|
|
283
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
284
|
+
id: setup-jfrog
|
|
285
|
+
env:
|
|
286
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
287
|
+
with:
|
|
288
|
+
oidc-provider-name: ovp-github-oidc
|
|
289
|
+
- name: Install dependencies
|
|
290
|
+
run: npm ci --ignore-scripts
|
|
291
|
+
env:
|
|
292
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
293
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
294
|
+
- name: Download artifacts folder
|
|
295
|
+
uses: actions/download-artifact@v4
|
|
296
|
+
with:
|
|
297
|
+
name: unisphere-applications
|
|
298
|
+
path: ${{ needs.prepare-applications.outputs.unisphereApplicationsArtifactsFolder }}
|
|
299
|
+
- name: Sync S3 bucket
|
|
300
|
+
run: |
|
|
301
|
+
npx unisphere application publish execute \
|
|
302
|
+
--env ${{ matrix.envs_regions.env }} \
|
|
303
|
+
--aws-region '${{ matrix.envs_regions.region }}' \
|
|
304
|
+
--aws-arn 'arn:aws:iam::${{matrix.envs_regions.accountid }}:role/${{ matrix.envs_regions.env }}-unisphere-content-role' \
|
|
305
|
+
--artifacts-folder '${{ needs.prepare-applications.outputs.unisphereApplicationsArtifactsFolder }}' \
|
|
306
|
+
--verbose
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/migrations/2-0-0/summary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/migrations/2-0-0/summary.ts"],"names":[],"mappings":"AAMA,0CAUC"}
|
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = default_1;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const open_1 = require("../utils/open");
|
|
6
|
+
const url = 'https://unisphere.kaltura.com/docs/create/changelog/v2-x-major-release';
|
|
7
|
+
const version = 'Major 2';
|
|
5
8
|
async function default_1() {
|
|
6
9
|
devkit_1.logger.info('');
|
|
7
|
-
devkit_1.logger.info(
|
|
10
|
+
devkit_1.logger.info(`🎉 Migration to ${version} finished successfully!`);
|
|
8
11
|
devkit_1.logger.info('');
|
|
9
12
|
devkit_1.logger.info('📋 Full details:');
|
|
10
|
-
devkit_1.logger.info(
|
|
13
|
+
devkit_1.logger.info(url);
|
|
11
14
|
devkit_1.logger.info('');
|
|
15
|
+
(0, open_1.openBrowser)(url);
|
|
16
|
+
devkit_1.logger.info('Opening changelog in browser...');
|
|
12
17
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace-github-workflow.d.ts","sourceRoot":"","sources":["../../../src/migrations/2-2-0/replace-github-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAI1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAkC9D"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
async function update(tree) {
|
|
8
|
+
devkit_1.logger.info('🔄 increases instance size for publish runtimes workflow');
|
|
9
|
+
// Ensure .github/workflows directory exists
|
|
10
|
+
if (!tree.exists('.github')) {
|
|
11
|
+
tree.write('.github/.gitkeep', '');
|
|
12
|
+
devkit_1.logger.info('✅ Created .github directory');
|
|
13
|
+
}
|
|
14
|
+
if (!tree.exists('.github/workflows')) {
|
|
15
|
+
tree.write('.github/workflows/.gitkeep', '');
|
|
16
|
+
devkit_1.logger.info('✅ Created .github/workflows directory');
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
// Update _publish-artifacts.yml
|
|
20
|
+
const publishArtifactsWorkflowPath = '.github/workflows/_publish-artifacts.yml';
|
|
21
|
+
const publishArtifactsTemplatePath = (0, path_1.join)(__dirname, 'templates', '_publish-artifacts.template');
|
|
22
|
+
const publishArtifactsTemplateContent = (0, fs_1.readFileSync)(publishArtifactsTemplatePath, 'utf-8');
|
|
23
|
+
const publishArtifactsExists = tree.exists(publishArtifactsWorkflowPath);
|
|
24
|
+
tree.write(publishArtifactsWorkflowPath, publishArtifactsTemplateContent);
|
|
25
|
+
if (publishArtifactsExists) {
|
|
26
|
+
devkit_1.logger.info(`✅ Updated ${publishArtifactsWorkflowPath} `);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
devkit_1.logger.info(`✅ Created ${publishArtifactsWorkflowPath}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
devkit_1.logger.error(`❌ Failed to update GitHub workflows: ${error?.message || 'Unknown error'}`);
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
name: Shared Deployment Jobs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
check-elements:
|
|
8
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
9
|
+
outputs:
|
|
10
|
+
has_packages: ${{ steps.check.outputs.has_packages }}
|
|
11
|
+
has_runtimes: ${{ steps.check.outputs.has_runtimes }}
|
|
12
|
+
has_applications: ${{ steps.check.outputs.has_applications }}
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout Repo
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
18
|
+
fetch-tags: true
|
|
19
|
+
|
|
20
|
+
- name: Check elements in .unisphere
|
|
21
|
+
id: check
|
|
22
|
+
run: |
|
|
23
|
+
if [ -f .unisphere ]; then
|
|
24
|
+
PACKAGES=$(jq -r '.elements.packages // {} | length' .unisphere)
|
|
25
|
+
RUNTIMES=$(jq -r '(.elements.runtimes // {} | length) + (.elements.workspace // {} | length) + (.elements.loader // {} | length)' .unisphere)
|
|
26
|
+
APPLICATIONS=$(jq -r '.elements.applications // {} | length' .unisphere)
|
|
27
|
+
|
|
28
|
+
if [ "$PACKAGES" -gt 0 ]; then
|
|
29
|
+
echo "has_packages=true" >> $GITHUB_OUTPUT
|
|
30
|
+
else
|
|
31
|
+
echo "has_packages=false" >> $GITHUB_OUTPUT
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
if [ "$RUNTIMES" -gt 0 ]; then
|
|
35
|
+
echo "has_runtimes=true" >> $GITHUB_OUTPUT
|
|
36
|
+
else
|
|
37
|
+
echo "has_runtimes=false" >> $GITHUB_OUTPUT
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
if [ "$APPLICATIONS" -gt 0 ]; then
|
|
41
|
+
echo "has_applications=true" >> $GITHUB_OUTPUT
|
|
42
|
+
else
|
|
43
|
+
echo "has_applications=false" >> $GITHUB_OUTPUT
|
|
44
|
+
fi
|
|
45
|
+
else
|
|
46
|
+
echo "has_packages=false" >> $GITHUB_OUTPUT
|
|
47
|
+
echo "has_runtimes=false" >> $GITHUB_OUTPUT
|
|
48
|
+
echo "has_applications=false" >> $GITHUB_OUTPUT
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
prepare-runtimes:
|
|
52
|
+
runs-on:
|
|
53
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
54
|
+
- instance-size:medium
|
|
55
|
+
|
|
56
|
+
if: needs.check-elements.outputs.has_runtimes == 'true'
|
|
57
|
+
needs: check-elements
|
|
58
|
+
outputs:
|
|
59
|
+
unisphereElementsArtifactsFolder: ${{ steps.prepare-runtimes.outputs.artifactsRootFolder }}
|
|
60
|
+
hasArtifacts: ${{ steps.prepare-runtimes.outputs.hasArtifacts }}
|
|
61
|
+
commit_sha: ${{ steps.capture_commit_sha.outputs.commit_sha }}
|
|
62
|
+
steps:
|
|
63
|
+
- name: Checkout Repo
|
|
64
|
+
uses: actions/checkout@v4
|
|
65
|
+
with:
|
|
66
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
67
|
+
fetch-tags: true
|
|
68
|
+
- name: Setup Node.js
|
|
69
|
+
uses: actions/setup-node@v4
|
|
70
|
+
with:
|
|
71
|
+
node-version-file: '.nvmrc'
|
|
72
|
+
- name: Clean workspace
|
|
73
|
+
run: git reset --hard HEAD
|
|
74
|
+
- name: Clean npm cache
|
|
75
|
+
run: npm cache clean --force
|
|
76
|
+
|
|
77
|
+
- name: Setup JFrog
|
|
78
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
79
|
+
id: setup-jfrog
|
|
80
|
+
env:
|
|
81
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
82
|
+
with:
|
|
83
|
+
oidc-provider-name: ovp-github-oidc
|
|
84
|
+
|
|
85
|
+
- name: Install dependencies
|
|
86
|
+
run: npm ci --ignore-scripts
|
|
87
|
+
env:
|
|
88
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
89
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
90
|
+
|
|
91
|
+
- name: Prepare Unisphere Elements
|
|
92
|
+
id: prepare-runtimes
|
|
93
|
+
run: npx unisphere runtime publish prepare --verbose
|
|
94
|
+
- name: Capture Commit SHA
|
|
95
|
+
id: capture_commit_sha
|
|
96
|
+
run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
|
97
|
+
- name: Set commit_sha as output
|
|
98
|
+
id: set_commit_sha
|
|
99
|
+
run: echo "commit_sha=${{ env.commit_sha }}" >> $GITHUB_OUTPUT
|
|
100
|
+
- uses: actions/upload-artifact@v4
|
|
101
|
+
id: upload-unisphere-elements-artifacts
|
|
102
|
+
with:
|
|
103
|
+
name: unisphere-elements
|
|
104
|
+
path: ${{ steps.prepare-runtimes.outputs.artifactsRootFolder }}
|
|
105
|
+
retention-days: 1
|
|
106
|
+
|
|
107
|
+
deploy-packages:
|
|
108
|
+
if: needs.check-elements.outputs.has_packages == 'true'
|
|
109
|
+
needs: check-elements
|
|
110
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
111
|
+
steps:
|
|
112
|
+
- name: Checkout Repo
|
|
113
|
+
uses: actions/checkout@v4
|
|
114
|
+
with:
|
|
115
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
116
|
+
fetch-tags: true
|
|
117
|
+
- name: Setup Node.js
|
|
118
|
+
uses: actions/setup-node@v4
|
|
119
|
+
with:
|
|
120
|
+
node-version-file: '.nvmrc'
|
|
121
|
+
|
|
122
|
+
- name: Setup JFrog
|
|
123
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
124
|
+
id: setup-jfrog
|
|
125
|
+
env:
|
|
126
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
127
|
+
with:
|
|
128
|
+
oidc-provider-name: ovp-github-oidc
|
|
129
|
+
|
|
130
|
+
- name: Install dependencies
|
|
131
|
+
run: |
|
|
132
|
+
npm ci --ignore-scripts
|
|
133
|
+
|
|
134
|
+
env:
|
|
135
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
136
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
137
|
+
|
|
138
|
+
- name: Get NPM Token from AWS Secrets Manager
|
|
139
|
+
id: get-npm-token
|
|
140
|
+
run: |
|
|
141
|
+
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"')
|
|
142
|
+
echo "NPM_TOKEN=$NPM_TOKEN" >> $GITHUB_ENV
|
|
143
|
+
# Debug token existence (safely)
|
|
144
|
+
echo "::debug::Token exists: $([ ! -z "$NPM_TOKEN" ] && echo 'true' || echo 'false')"
|
|
145
|
+
- name: Deploy to registry
|
|
146
|
+
run: npx unisphere package publish --verbose --githubToken ${{ secrets.GITHUB_TOKEN }} --npmToken ${{ env.NPM_TOKEN }} --branch "${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}"
|
|
147
|
+
|
|
148
|
+
deploy-runtimes:
|
|
149
|
+
if: needs.prepare-runtimes.outputs.hasArtifacts == 'true'
|
|
150
|
+
needs: prepare-runtimes
|
|
151
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
152
|
+
strategy:
|
|
153
|
+
matrix:
|
|
154
|
+
envs_regions:
|
|
155
|
+
- { env: 'nvp1', region: 'us-east-1', accountid: '583352821080' }
|
|
156
|
+
- { env: 'frp2', region: 'eu-central-1', accountid: '082111255551' }
|
|
157
|
+
- { env: 'irp2', region: 'eu-west-1', accountid: '137576761235' }
|
|
158
|
+
- { env: 'nvq2', region: 'us-east-1', accountid: '383697330906' }
|
|
159
|
+
- { env: 'sgp2', region: 'ap-southeast-1', accountid: '882351240370' }
|
|
160
|
+
- { env: 'syp2', region: 'ap-southeast-2', accountid: '650755435642' }
|
|
161
|
+
- { env: 'cap2', region: 'ca-central-1', accountid: '948632009361' }
|
|
162
|
+
fail-fast: false
|
|
163
|
+
|
|
164
|
+
steps:
|
|
165
|
+
- name: Check available disk space
|
|
166
|
+
run: df -h
|
|
167
|
+
- name: Checkout Repo at specific commit
|
|
168
|
+
uses: actions/checkout@v4
|
|
169
|
+
with:
|
|
170
|
+
ref: ${{ needs.prepare-runtimes.outputs.commit_sha }}
|
|
171
|
+
fetch-tags: true
|
|
172
|
+
- name: Setup Node.js
|
|
173
|
+
uses: actions/setup-node@v4
|
|
174
|
+
with:
|
|
175
|
+
node-version-file: '.nvmrc'
|
|
176
|
+
|
|
177
|
+
- name: Setup JFrog
|
|
178
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
179
|
+
id: setup-jfrog
|
|
180
|
+
env:
|
|
181
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
182
|
+
with:
|
|
183
|
+
oidc-provider-name: ovp-github-oidc
|
|
184
|
+
|
|
185
|
+
- name: Install dependencies
|
|
186
|
+
run: |
|
|
187
|
+
npm ci --ignore-scripts
|
|
188
|
+
env:
|
|
189
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
190
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
191
|
+
|
|
192
|
+
- name: Download artifacts folder
|
|
193
|
+
uses: actions/download-artifact@v4
|
|
194
|
+
with:
|
|
195
|
+
name: unisphere-elements
|
|
196
|
+
path: ${{ needs.prepare-runtimes.outputs.unisphereElementsArtifactsFolder }}
|
|
197
|
+
- name: Sync S3 bucket
|
|
198
|
+
run: |
|
|
199
|
+
npx unisphere runtime publish execute \
|
|
200
|
+
--env ${{ matrix.envs_regions.env }} \
|
|
201
|
+
--aws-region '${{ matrix.envs_regions.region }}' \
|
|
202
|
+
--aws-arn 'arn:aws:iam::${{matrix.envs_regions.accountid }}:role/${{ matrix.envs_regions.env }}-unisphere-content-role' \
|
|
203
|
+
--artifacts-folder '${{ needs.prepare-runtimes.outputs.unisphereElementsArtifactsFolder }}' \
|
|
204
|
+
--verbose
|
|
205
|
+
|
|
206
|
+
prepare-applications:
|
|
207
|
+
if: always() && needs.check-elements.outputs.has_applications == 'true'
|
|
208
|
+
needs: [deploy-runtimes, check-elements]
|
|
209
|
+
runs-on:
|
|
210
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
211
|
+
- instance-size:medium
|
|
212
|
+
outputs:
|
|
213
|
+
unisphereApplicationsArtifactsFolder: ${{ steps.prepare-applications.outputs.artifactsRootFolder }}
|
|
214
|
+
hasArtifacts: ${{ steps.prepare-applications.outputs.hasArtifacts }}
|
|
215
|
+
commit_sha: ${{ steps.capture_commit_sha.outputs.commit_sha }}
|
|
216
|
+
steps:
|
|
217
|
+
- name: Checkout Repo
|
|
218
|
+
uses: actions/checkout@v4
|
|
219
|
+
with:
|
|
220
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
221
|
+
fetch-tags: true
|
|
222
|
+
- name: Setup Node.js
|
|
223
|
+
uses: actions/setup-node@v4
|
|
224
|
+
with:
|
|
225
|
+
node-version-file: '.nvmrc'
|
|
226
|
+
- name: Clean workspace
|
|
227
|
+
run: git reset --hard HEAD
|
|
228
|
+
- name: Clean npm cache
|
|
229
|
+
run: npm cache clean --force
|
|
230
|
+
- name: Setup JFrog
|
|
231
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
232
|
+
id: setup-jfrog
|
|
233
|
+
env:
|
|
234
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
235
|
+
with:
|
|
236
|
+
oidc-provider-name: ovp-github-oidc
|
|
237
|
+
- name: Install dependencies
|
|
238
|
+
run: npm ci --ignore-scripts
|
|
239
|
+
env:
|
|
240
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
241
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
242
|
+
- name: Prepare Unisphere Applications
|
|
243
|
+
id: prepare-applications
|
|
244
|
+
run: npx unisphere application publish prepare --verbose
|
|
245
|
+
- name: Capture Commit SHA
|
|
246
|
+
id: capture_commit_sha
|
|
247
|
+
run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
|
248
|
+
- name: Set commit_sha as output
|
|
249
|
+
id: set_commit_sha
|
|
250
|
+
run: echo "commit_sha=${{ env.commit_sha }}" >> $GITHUB_OUTPUT
|
|
251
|
+
- uses: actions/upload-artifact@v4
|
|
252
|
+
id: upload-unisphere-applications-artifacts
|
|
253
|
+
with:
|
|
254
|
+
name: unisphere-applications
|
|
255
|
+
path: ${{ steps.prepare-applications.outputs.artifactsRootFolder }}
|
|
256
|
+
retention-days: 1
|
|
257
|
+
|
|
258
|
+
deploy-applications:
|
|
259
|
+
if: always() && needs.prepare-applications.outputs.hasArtifacts == 'true'
|
|
260
|
+
needs: [prepare-applications]
|
|
261
|
+
runs-on:
|
|
262
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
263
|
+
- instance-size:medium
|
|
264
|
+
strategy:
|
|
265
|
+
matrix:
|
|
266
|
+
envs_regions:
|
|
267
|
+
- { env: 'nvp1', region: 'us-east-1', accountid: '583352821080' }
|
|
268
|
+
- { env: 'frp2', region: 'eu-central-1', accountid: '082111255551' }
|
|
269
|
+
- { env: 'irp2', region: 'eu-west-1', accountid: '137576761235' }
|
|
270
|
+
- { env: 'nvq2', region: 'us-east-1', accountid: '383697330906' }
|
|
271
|
+
- { env: 'sgp2', region: 'ap-southeast-1', accountid: '882351240370' }
|
|
272
|
+
- { env: 'syp2', region: 'ap-southeast-2', accountid: '650755435642' }
|
|
273
|
+
- { env: 'cap2', region: 'ca-central-1', accountid: '948632009361' }
|
|
274
|
+
fail-fast: false
|
|
275
|
+
steps:
|
|
276
|
+
- name: Checkout Repo at specific commit
|
|
277
|
+
uses: actions/checkout@v4
|
|
278
|
+
with:
|
|
279
|
+
ref: ${{ needs.prepare-applications.outputs.commit_sha }}
|
|
280
|
+
fetch-tags: true
|
|
281
|
+
- name: Setup Node.js
|
|
282
|
+
uses: actions/setup-node@v4
|
|
283
|
+
with:
|
|
284
|
+
node-version-file: '.nvmrc'
|
|
285
|
+
- name: Setup JFrog
|
|
286
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
287
|
+
id: setup-jfrog
|
|
288
|
+
env:
|
|
289
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
290
|
+
with:
|
|
291
|
+
oidc-provider-name: ovp-github-oidc
|
|
292
|
+
- name: Install dependencies
|
|
293
|
+
run: npm ci --ignore-scripts
|
|
294
|
+
env:
|
|
295
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
296
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
297
|
+
- name: Download artifacts folder
|
|
298
|
+
uses: actions/download-artifact@v4
|
|
299
|
+
with:
|
|
300
|
+
name: unisphere-applications
|
|
301
|
+
path: ${{ needs.prepare-applications.outputs.unisphereApplicationsArtifactsFolder }}
|
|
302
|
+
- name: Sync S3 bucket
|
|
303
|
+
run: |
|
|
304
|
+
npx unisphere application publish execute \
|
|
305
|
+
--env ${{ matrix.envs_regions.env }} \
|
|
306
|
+
--aws-region '${{ matrix.envs_regions.region }}' \
|
|
307
|
+
--aws-arn 'arn:aws:iam::${{matrix.envs_regions.accountid }}:role/${{ matrix.envs_regions.env }}-unisphere-content-role' \
|
|
308
|
+
--artifacts-folder '${{ needs.prepare-applications.outputs.unisphereApplicationsArtifactsFolder }}' \
|
|
309
|
+
--verbose
|