Skip to content

Commit

Permalink
Fix: Do not hard-code SDK versions in CI (#339)
Browse files Browse the repository at this point in the history
* Fixed hardcoded Firebolt version in CI for build CPP SDK

* Update cxx-build.yml

* Update cxx-build.yml

* Reverted back

* Update cxx-build.yml

* Update utils.sh
  • Loading branch information
kdivya153 authored Nov 5, 2024
1 parent eb10d13 commit bdee717
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cxx-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,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
6 changes: 3 additions & 3 deletions .github/workflows/utils.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash
set -o pipefail

FIREBOLT_VERSION=1.0.0-next.0
current_apis_dir=$(pwd)

cd ..
Expand Down Expand Up @@ -258,13 +257,14 @@ 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 ************"
Expand Down
5 changes: 3 additions & 2 deletions src/sdks/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions src/sdks/discovery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions src/sdks/manage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit bdee717

Please sign in to comment.