Skip to content

Commit

Permalink
fix: Added block to generate native source
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinshahfws committed Jul 10, 2024
1 parent 8c21f10 commit b823b44
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ jobs:
uses: andstor/file-existence-action@v2
with:
files: './src/sdks/core/dist/lib/firebolt.mjs'
- name: Generate native sdk source
run: |
.github/workflows/utils.sh generateSource
- name: Release Firebolt SDKs to NPM
if: steps.check_build.outputs.files_exists == 'true' && github.event_name != 'pull_request' && (github.ref_name != 'main' || github.event_name == 'workflow_dispatch')
env:
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,52 @@ function unzipArtifact(){
echo "Failures=$failures" >> "$GITHUB_ENV"
}

function generateSource() {
echo " ************ Generate Source ************"
pwd
ls -la

echo "Generate source for Core SDK"
cd src/sdks/core
npm run cpp

if [ $? -eq 0 ]
then
echo "Native Core SDK generated successfully"
else
echo "Native Core SDK generation failed"
exit 1
fi

echo "Generate source for Manage SDK"
cd ../manage
npm run cpp

if [ $? -eq 0 ]
then
echo "Native Manage SDK generated successfully"
else
echo "Native Manage SDK generation failed"
exit 1
fi

echo "Generate source for Discovery SDK"
cd ../discovery
npm run cpp

if [ $? -eq 0 ]
then
echo "Native Discovery SDK generated successfully"
else
echo "Native Discovery SDK generation failed"
exit 1
fi

echo "************ Source Generation Completed ************"
pwd
ls -la
}

# Check argument and call corresponding function
if [ "$1" == "runTests" ]; then
runTests
Expand All @@ -156,6 +202,8 @@ elif [ "$1" == "getArtifactData" ]; then
getArtifactData
elif [ "$1" == "unzipArtifact" ]; then
unzipArtifact
elif [ "$1" == "generateSource" ]; then
generateSource
else
echo "Invalid function specified."
exit 1
Expand Down

0 comments on commit b823b44

Please sign in to comment.