@unisphere/nx 2.1.3 → 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.
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export default function update(tree: Tree): Promise<void>;
3
+ //# sourceMappingURL=replace-github-workflow.d.ts.map
@@ -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
package/migrations.json CHANGED
@@ -160,7 +160,15 @@
160
160
  "cli": {
161
161
  "postUpdateMessage": "✅ rollup-plugin-node-builtins dependency has been removed"
162
162
  }
163
- }
163
+ },
164
+ "2-2-0-replace-github-workflow": {
165
+ "version": "2.2.0",
166
+ "description": "increases instance size for publish runtimes workflow",
167
+ "factory": "./dist/migrations/2-2-0/replace-github-workflow.js",
168
+ "cli": {
169
+ "postUpdateMessage": "✅ GitHub workflow updated with some changes."
170
+ }
171
+ },
164
172
  },
165
173
  "packageJsonUpdates": {
166
174
  "1.22.0": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/nx",
3
- "version": "2.1.3",
3
+ "version": "2.2.0",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",