From fe00727292372cd68b4a3782e6e0c69018a239ab Mon Sep 17 00:00:00 2001 From: "Kandasamy, Divya" Date: Mon, 28 Oct 2024 13:14:24 -0400 Subject: [PATCH 1/6] Fixed hardcoded Firebolt version in CI for build CPP SDK --- .github/workflows/utils.sh | 5 ++--- package.json | 2 +- src/sdks/core/package.json | 5 +++-- src/sdks/discovery/package.json | 5 +++-- src/sdks/manage/package.json | 5 +++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/utils.sh b/.github/workflows/utils.sh index 53533036..4d221da4 100755 --- a/.github/workflows/utils.sh +++ b/.github/workflows/utils.sh @@ -1,7 +1,6 @@ #!/bin/bash set -o pipefail -FIREBOLT_VERSION=1.0.0-next.0 current_apis_dir=$(pwd) cd .. @@ -258,13 +257,13 @@ function generate_cpp_sdk_source_code(){ echo " ************ Genrate Source Code for ${sdk_name^} CPP SDK ************" - FIREBOLT_VERSION=1.3.0-next.1 cd src/sdks/${sdk_name} npm run cpp } function build_cpp_sdk() { - FIREBOLT_VERSION=1.3.0-next.1 + FIREBOLT_VERSION=$(node -p "require('./package.json').version") + echo "The version from package.json is $FIREBOLT_VERSION" local sdk_name=$1 echo " ************ Build ${sdk_name^} CPP SDK ************" diff --git a/package.json b/package.json index c0bca55c..a2275b55 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "devDependencies": { "@commitlint/cli": "^17.0.3", "@commitlint/config-conventional": "^17.0.3", - "@firebolt-js/openrpc": "3.1.1", + "@firebolt-js/openrpc": "rdkcentral/firebolt-openrpc#fix/ci-fb-version", "@firebolt-js/schemas": "2.0.0", "@saithodev/semantic-release-backmerge": "^3.2.0", "@semantic-release/changelog": "^6.0.1", diff --git a/src/sdks/core/package.json b/src/sdks/core/package.json index 97473c7f..0ffd1ba7 100644 --- a/src/sdks/core/package.json +++ b/src/sdks/core/package.json @@ -11,7 +11,7 @@ "native": "npx firebolt-openrpc sdk --input ./dist/firebolt-core-open-rpc.json --template ./src/cpp --output ./build/c/src --static-module Platform --language ../../../node_modules/@firebolt-js/openrpc/languages/c", "cpp": "npm run cpp:compile && cp ./dist/firebolt-core-open-rpc.json ./build/cpp/src && npm run cpp:install", "cpp:compile": "npx firebolt-openrpc sdk --input ./dist/firebolt-core-open-rpc.json --template ./src/cpp --output ./build/cpp/src --static-module Platform --language ../../../node_modules/@firebolt-js/openrpc/languages/cpp", - "cpp:install": "./build/cpp/src/scripts/install.sh -i ./build/cpp/src -s ./build/cpp/src/ -m core", + "cpp:install": "chmod +x ./build/cpp/src/scripts/install.sh && sdkVersion=$(npm run -s getVersion) && ./build/cpp/src/scripts/install.sh -i ./build/cpp/src -s ./build/cpp/src/ -m core -v $sdkVersion", "compile": "cd ../../.. && npm run compile", "slice": "npx firebolt-openrpc slice -i ../../../dist/firebolt-open-rpc.json --sdk ./sdk.config.json -o ./dist/firebolt-core-open-rpc.json", "docs": "npx firebolt-openrpc docs --input ./dist/firebolt-core-open-rpc.json --output build/docs/markdown --as-path", @@ -26,7 +26,8 @@ "test": "npm run test:setup && NODE_OPTIONS=--experimental-vm-modules npx --config=jest.config.json --detectOpenHandles jest", "prepack": "node ../../js/version.mjs validate && npm run broilerplate", "broilerplate": "rm ./CONTRIBUTING.md && cp ../../../CONTRIBUTING.md ./CONTRIBUTING.md && rm ./LICENSE && cp ../../../LICENSE ./LICENSE && rm ./NOTICE && cp ../../../NOTICE ./NOTICE", - "prettier": "prettier build/**/*.mjs --write --parser babel && prettier build/**/*.md --write --parser markdown" + "prettier": "prettier build/**/*.mjs --write --parser babel && prettier build/**/*.md --write --parser markdown", + "getVersion": "node -p \"require('./package.json').version\"" }, "repository": { "type": "git", diff --git a/src/sdks/discovery/package.json b/src/sdks/discovery/package.json index e229f48c..b4e02089 100644 --- a/src/sdks/discovery/package.json +++ b/src/sdks/discovery/package.json @@ -11,7 +11,7 @@ "native": "npx firebolt-openrpc sdk --input ./dist/firebolt-discovery-open-rpc.json --template ./src/js --output ./build/c/src --language ../../../node_modules/@firebolt-js/openrpc/languages/c", "cpp": "npm run cpp:compile && cp ./dist/firebolt-discovery-open-rpc.json ./build/cpp/src && npm run cpp:install", "cpp:compile": "npx firebolt-openrpc sdk --input ./dist/firebolt-discovery-open-rpc.json --template ./src/cpp --output ./build/cpp/src --static-module Platform --language ../../../node_modules/@firebolt-js/openrpc/languages/cpp", - "cpp:install": "./build/cpp/src/scripts/install.sh -i ./build/cpp/src -s ./build/cpp/src/ -m discovery", + "cpp:install": "chmod +x ./build/cpp/src/scripts/install.sh && sdkVersion=$(npm run -s getVersion) && ./build/cpp/src/scripts/install.sh -i ./build/cpp/src -s ./build/cpp/src/ -m discovery -v $sdkVersion", "compile": "cd ../../.. && npm run compile", "slice": "npx firebolt-openrpc slice -i ../../../dist/firebolt-open-rpc.json --sdk ./sdk.config.json -o ./dist/firebolt-discovery-open-rpc.json", "docs": "npx firebolt-openrpc docs --input ./dist/firebolt-discovery-open-rpc.json --output build/docs/markdown --as-path", @@ -26,7 +26,8 @@ "test": "npm run test:setup && NODE_OPTIONS=--experimental-vm-modules npx --config=jest.config.json --detectOpenHandles jest", "prepack": "node ../../js/version.mjs validate && npm run broilerplate", "broilerplate": "rm ./CONTRIBUTING.md && cp ../../../CONTRIBUTING.md ./CONTRIBUTING.md && rm ./LICENSE && cp ../../../LICENSE ./LICENSE && rm ./NOTICE && cp ../../../NOTICE ./NOTICE", - "prettier": "prettier build/**/*.mjs --write --parser babel && prettier build/**/*.md --write --parser markdown" + "prettier": "prettier build/**/*.mjs --write --parser babel && prettier build/**/*.md --write --parser markdown", + "getVersion": "node -p \"require('./package.json').version\"" }, "repository": { "type": "git", diff --git a/src/sdks/manage/package.json b/src/sdks/manage/package.json index 90d51e3a..6e3a6317 100644 --- a/src/sdks/manage/package.json +++ b/src/sdks/manage/package.json @@ -11,7 +11,7 @@ "native": "npx firebolt-openrpc sdk --input ./dist/firebolt-manage-open-rpc.json --template ./src/js --output ./build/c/src --language ../../../node_modules/@firebolt-js/openrpc/languages/c", "cpp": "npm run cpp:compile && cp ./dist/firebolt-manage-open-rpc.json ./build/cpp/src && npm run cpp:install", "cpp:compile": "npx firebolt-openrpc sdk --input ./dist/firebolt-manage-open-rpc.json --template ./src/cpp --output ./build/cpp/src --static-module Platform --language ../../../node_modules/@firebolt-js/openrpc/languages/cpp", - "cpp:install": "./build/cpp/src/scripts/install.sh -i ./build/cpp/src -s ./build/cpp/src/ -m manage", + "cpp:install": "chmod +x ./build/cpp/src/scripts/install.sh && sdkVersion=$(npm run -s getVersion) && ./build/cpp/src/scripts/install.sh -i ./build/cpp/src -s ./build/cpp/src/ -m manage -v $sdkVersion", "compile": "cd ../../.. && npm run compile", "slice": "npx firebolt-openrpc slice -i ../../../dist/firebolt-open-rpc.json --sdk ./sdk.config.json -o ./dist/firebolt-manage-open-rpc.json", "docs": "npx firebolt-openrpc docs --input ./dist/firebolt-manage-open-rpc.json --output build/docs/markdown --as-path", @@ -26,7 +26,8 @@ "test": "npm run test:setup && NODE_OPTIONS=--experimental-vm-modules npx --config=jest.config.json --detectOpenHandles jest", "prepack": "node ../../js/version.mjs validate && npm run broilerplate", "broilerplate": "rm ./CONTRIBUTING.md && cp ../../../CONTRIBUTING.md ./CONTRIBUTING.md && rm ./LICENSE && cp ../../../LICENSE ./LICENSE && rm ./NOTICE && cp ../../../NOTICE ./NOTICE", - "prettier": "prettier build/**/*.mjs --write --parser babel && prettier build/**/*.md --write --parser markdown" + "prettier": "prettier build/**/*.mjs --write --parser babel && prettier build/**/*.md --write --parser markdown", + "getVersion": "node -p \"require('./package.json').version\"" }, "repository": { "type": "git", From 1d91b9ab3db16ffb2e05d4623d29f99ac909c157 Mon Sep 17 00:00:00 2001 From: "Kandasamy, Divya" Date: Mon, 28 Oct 2024 13:23:30 -0400 Subject: [PATCH 2/6] Update cxx-build.yml --- .github/workflows/cxx-build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/cxx-build.yml b/.github/workflows/cxx-build.yml index 221ef8b3..8c355cdd 100644 --- a/.github/workflows/cxx-build.yml +++ b/.github/workflows/cxx-build.yml @@ -61,6 +61,9 @@ jobs: path: ~/.npm key: deps-node-modules-${{ hashFiles('package-lock.json') }} + - name: Install dev dependencies + run: npm install + - name: Install dependencies run: npm ci From 90038982002f14b401063eaac87da3e9e2f3e0ae Mon Sep 17 00:00:00 2001 From: "Kandasamy, Divya" Date: Mon, 28 Oct 2024 13:33:25 -0400 Subject: [PATCH 3/6] Update cxx-build.yml --- .github/workflows/cxx-build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/cxx-build.yml b/.github/workflows/cxx-build.yml index 8c355cdd..21cf7b65 100644 --- a/.github/workflows/cxx-build.yml +++ b/.github/workflows/cxx-build.yml @@ -123,6 +123,9 @@ jobs: path: ~/.npm key: deps-node-modules-${{ hashFiles('package-lock.json') }} + - name: Install dev dependencies + run: npm install + - name: Install npm dependencies run: npm ci @@ -162,6 +165,9 @@ jobs: path: ~/.npm key: deps-node-modules-${{ hashFiles('package-lock.json') }} + - name: Install dev dependencies + run: npm install + - name: Install npm dependencies run: npm ci @@ -201,6 +207,9 @@ jobs: path: ~/.npm key: deps-node-modules-${{ hashFiles('package-lock.json') }} + - name: Install dev dependencies + run: npm install + - name: Install npm dependencies run: npm ci From 33ad78905448612be82fe84c6046a71c21be3523 Mon Sep 17 00:00:00 2001 From: "Kandasamy, Divya" Date: Tue, 29 Oct 2024 11:45:28 -0400 Subject: [PATCH 4/6] Reverted back --- .github/workflows/cxx-build.yml | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cxx-build.yml b/.github/workflows/cxx-build.yml index 21cf7b65..4d543919 100644 --- a/.github/workflows/cxx-build.yml +++ b/.github/workflows/cxx-build.yml @@ -62,7 +62,7 @@ jobs: key: deps-node-modules-${{ hashFiles('package-lock.json') }} - name: Install dev dependencies - run: npm install + run: npm ci - name: Install dependencies run: npm ci @@ -124,7 +124,7 @@ jobs: key: deps-node-modules-${{ hashFiles('package-lock.json') }} - name: Install dev dependencies - run: npm install + run: npm ci - name: Install npm dependencies run: npm ci @@ -166,7 +166,7 @@ jobs: key: deps-node-modules-${{ hashFiles('package-lock.json') }} - name: Install dev dependencies - run: npm install + run: npm ci - name: Install npm dependencies run: npm ci @@ -208,7 +208,7 @@ jobs: key: deps-node-modules-${{ hashFiles('package-lock.json') }} - name: Install dev dependencies - run: npm install + run: npm ci - name: Install npm dependencies run: npm ci diff --git a/package.json b/package.json index a2275b55..c0bca55c 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "devDependencies": { "@commitlint/cli": "^17.0.3", "@commitlint/config-conventional": "^17.0.3", - "@firebolt-js/openrpc": "rdkcentral/firebolt-openrpc#fix/ci-fb-version", + "@firebolt-js/openrpc": "3.1.1", "@firebolt-js/schemas": "2.0.0", "@saithodev/semantic-release-backmerge": "^3.2.0", "@semantic-release/changelog": "^6.0.1", From 652252efab08325ce6e24f9df5dabd80374d1f24 Mon Sep 17 00:00:00 2001 From: "Kandasamy, Divya" Date: Tue, 29 Oct 2024 13:15:29 -0400 Subject: [PATCH 5/6] Update cxx-build.yml --- .github/workflows/cxx-build.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/cxx-build.yml b/.github/workflows/cxx-build.yml index 4d543919..b87ed6c6 100644 --- a/.github/workflows/cxx-build.yml +++ b/.github/workflows/cxx-build.yml @@ -61,9 +61,6 @@ jobs: path: ~/.npm key: deps-node-modules-${{ hashFiles('package-lock.json') }} - - name: Install dev dependencies - run: npm ci - - name: Install dependencies run: npm ci @@ -123,9 +120,6 @@ jobs: path: ~/.npm key: deps-node-modules-${{ hashFiles('package-lock.json') }} - - name: Install dev dependencies - run: npm ci - - name: Install npm dependencies run: npm ci @@ -165,9 +159,6 @@ jobs: path: ~/.npm key: deps-node-modules-${{ hashFiles('package-lock.json') }} - - name: Install dev dependencies - run: npm ci - - name: Install npm dependencies run: npm ci @@ -207,9 +198,6 @@ jobs: path: ~/.npm key: deps-node-modules-${{ hashFiles('package-lock.json') }} - - name: Install dev dependencies - run: npm ci - - name: Install npm dependencies run: npm ci @@ -219,4 +207,4 @@ jobs: - name: Build CXX Discovery SDK run: | - .github/workflows/utils.sh build_discovery_cpp_sdk + .github/workflows/utils.sh build_discovery_cpp_sdk \ No newline at end of file From 138d56a31099c39a836cf21238873ced18b33dfe Mon Sep 17 00:00:00 2001 From: "Kandasamy, Divya" Date: Tue, 29 Oct 2024 14:32:31 -0400 Subject: [PATCH 6/6] Update utils.sh --- .github/workflows/utils.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/utils.sh b/.github/workflows/utils.sh index 4d221da4..b385fe38 100755 --- a/.github/workflows/utils.sh +++ b/.github/workflows/utils.sh @@ -262,6 +262,7 @@ function generate_cpp_sdk_source_code(){ } function build_cpp_sdk() { + FIREBOLT_VERSION=$(node -p "require('./package.json').version") echo "The version from package.json is $FIREBOLT_VERSION" local sdk_name=$1