@unisphere/nx 3.4.1 → 3.5.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/migrations/3-5-0/templates/cicd.template +89 -0
- package/dist/migrations/3-5-0/update-cicd-workflow.d.ts +3 -0
- package/dist/migrations/3-5-0/update-cicd-workflow.d.ts.map +1 -0
- package/dist/migrations/3-5-0/update-cicd-workflow.js +36 -0
- package/migrations.json +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
name: CI/CD
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- 'prerelease/**'
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
id-token: write
|
|
11
|
+
contents: write
|
|
12
|
+
packages: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
release:
|
|
16
|
+
name: Release
|
|
17
|
+
runs-on:
|
|
18
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
19
|
+
- instance-size:medium
|
|
20
|
+
outputs:
|
|
21
|
+
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
|
|
22
|
+
steps:
|
|
23
|
+
|
|
24
|
+
- name: Cache npm
|
|
25
|
+
uses: actions/cache@v3
|
|
26
|
+
with:
|
|
27
|
+
path: ~/.npm
|
|
28
|
+
key: dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-${{ hashFiles('package-lock.json') }}
|
|
29
|
+
restore-keys: |
|
|
30
|
+
dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-
|
|
31
|
+
|
|
32
|
+
- name: Checkout Repo
|
|
33
|
+
uses: actions/checkout@v4
|
|
34
|
+
|
|
35
|
+
- name: Check if part of prerelease or official release
|
|
36
|
+
id: check
|
|
37
|
+
run: |
|
|
38
|
+
if [ "${{ github.ref }}" = "refs/heads/main" ] && [ -f ".changeset/pre.json" ]; then
|
|
39
|
+
echo "main branch should not have pre.json file, skipping job"
|
|
40
|
+
exit 1
|
|
41
|
+
elif [[ "${{ github.ref }}" == "refs/heads/prerelease/"* ]] && [ ! -f ".changeset/pre.json" ]; then
|
|
42
|
+
echo "prerelease branch must have pre.json file, skipping job"
|
|
43
|
+
exit 1
|
|
44
|
+
elif [ "${{ github.ref }}" != "refs/heads/main" ] && [[ "${{ github.ref }}" != "refs/heads/prerelease/"* ]]; then
|
|
45
|
+
echo "not part of prerelease or official release, skipping job"
|
|
46
|
+
exit 1
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
- name: Setup Node.js
|
|
50
|
+
uses: actions/setup-node@v4
|
|
51
|
+
with:
|
|
52
|
+
node-version-file: '.nvmrc'
|
|
53
|
+
|
|
54
|
+
- name: Pre-CICD Checks
|
|
55
|
+
uses: kaltura/unisphere-core/.github/actions/pre-cicd@main
|
|
56
|
+
with:
|
|
57
|
+
repo-path: '${{ github.workspace }}'
|
|
58
|
+
|
|
59
|
+
- name: Setup JFrog
|
|
60
|
+
|
|
61
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
62
|
+
id: setup-jfrog
|
|
63
|
+
env:
|
|
64
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
65
|
+
with:
|
|
66
|
+
oidc-provider-name: ovp-github-oidc
|
|
67
|
+
|
|
68
|
+
- name: Install Dependencies
|
|
69
|
+
run: npm ci --prefer-offline --include=optional --no-fund
|
|
70
|
+
env:
|
|
71
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
72
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
73
|
+
|
|
74
|
+
- name: Create Release Pull Request or Publish to npm
|
|
75
|
+
id: changesets
|
|
76
|
+
uses: changesets/action@v1
|
|
77
|
+
env:
|
|
78
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
79
|
+
|
|
80
|
+
- name: Create release tags
|
|
81
|
+
if: steps.changesets.outputs.hasChangesets == 'false'
|
|
82
|
+
run: |
|
|
83
|
+
npx changeset tag
|
|
84
|
+
git push --follow-tags
|
|
85
|
+
|
|
86
|
+
publish-artifacts:
|
|
87
|
+
needs: release
|
|
88
|
+
if: needs.release.outputs.hasChangesets == 'false'
|
|
89
|
+
uses: ./.github/workflows/_publish-artifacts.yml
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-cicd-workflow.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-5-0/update-cicd-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAI1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAiC9D"}
|
|
@@ -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('🔄 Updating GitHub CICD workflow for v3.5.0');
|
|
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 cicd.yml
|
|
20
|
+
const cicdWorkflowPath = '.github/workflows/cicd.yml';
|
|
21
|
+
const cicdTemplatePath = (0, path_1.join)(__dirname, 'templates', 'cicd.template');
|
|
22
|
+
const cicdTemplateContent = (0, fs_1.readFileSync)(cicdTemplatePath, 'utf-8');
|
|
23
|
+
const cicdExists = tree.exists(cicdWorkflowPath);
|
|
24
|
+
tree.write(cicdWorkflowPath, cicdTemplateContent);
|
|
25
|
+
if (cicdExists) {
|
|
26
|
+
devkit_1.logger.info(`✅ Updated ${cicdWorkflowPath}`);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
devkit_1.logger.info(`✅ Created ${cicdWorkflowPath}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
devkit_1.logger.error(`❌ Failed to update GitHub CICD workflow: ${error?.message || 'Unknown error'}`);
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
}
|
package/migrations.json
CHANGED
|
@@ -290,6 +290,14 @@
|
|
|
290
290
|
"cli": {
|
|
291
291
|
"postUpdateMessage": "✅ .gitignore updated to exclude .claude/settings.local.json"
|
|
292
292
|
}
|
|
293
|
+
},
|
|
294
|
+
"3-5-0-update-cicd-workflow": {
|
|
295
|
+
"version": "3.5.0",
|
|
296
|
+
"description": "Updates .github/workflows/cicd.yml with JFrog OIDC setup and improved cache management",
|
|
297
|
+
"factory": "./dist/migrations/3-5-0/update-cicd-workflow.js",
|
|
298
|
+
"cli": {
|
|
299
|
+
"postUpdateMessage": "✅ .github/workflows/cicd.yml updated successfully"
|
|
300
|
+
}
|
|
293
301
|
}
|
|
294
302
|
},
|
|
295
303
|
"packageJsonUpdates": {
|