@@ -88,39 +88,47 @@ jobs:
8888 npm run dist
8989 - name : Check if semantic-release created a build
9090 id : check_build
91- uses : andstor/file-existence-action@v2
91+ uses : actions/github-script@v6
9292 with :
93- files : ' ./src/sdks/ripple/dist/lib/firebolt-ripple.mjs'
94-
93+ script : |
94+ const fs = require('fs');
95+ const path = './src/sdks/lifecycle-manager/dist/lib/lifecycle-manager.mjs';
96+ return fs.existsSync(path);
97+ - name : File Existence Output
98+ run : |
99+ echo "File exists: ${{ steps.check_build.outputs.result }}"
95100 - name : Get version from package.json
96101 run : |
97102 RELEASE_VERSION=$(node -p "require('./package.json').version")
98103 echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
99104 echo "build_cpp_source=true" >> $GITHUB_ENV
100105 - name : Set cpp build source Condition
101- if : steps.check_build.outputs.files_exists == 'false' || (github.ref_name == 'main' && github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch')
106+ if : steps.check_build.outputs.result == 'false' || (github.ref_name == 'main' && github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch')
102107 run : echo "build_cpp_source=false" >> $GITHUB_ENV
103- - name : Generate and configure SSH key
108+ - name : Release Firebolt SDKs to NPM
109+ if : steps.check_build.outputs.result == 'true' && github.event_name != 'pull_request' && (github.ref_name != 'main' || github.event_name == 'workflow_dispatch')
110+ env :
111+ NPM_TOKEN : ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }} # <-- Allows semantic-release to publish to npm without 2 factor auth.
104112 run : |
105- mkdir -p /root/.ssh
106- echo "${{ secrets.SSH_PRIVATE_KEY }}" > /root/.ssh/id_ed25519
107- chmod 600 /root/.ssh/id_ed25519
108-
109- touch /root/.ssh/known_hosts
110- chmod 644 /root/.ssh/known_hosts
111- ssh-keyscan github.com >> /root/.ssh/known_hosts
112- chmod 644 /root/.ssh/known_hosts
113+ npm --version
114+ echo "NPM DIST TAG :: " $NPM_DIST_TAG
115+ npm publish --tag $NPM_DIST_TAG --workspaces --access=public
116+ - name : Dry-run Firebolt SDKs to NPM
117+ if : steps.check_build.outputs.result == 'true' && (github.ref_name == 'main' && github.event_name != 'workflow_dispatch')
118+ env :
119+ NPM_TOKEN : ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }} # <-- Allows semantic-release to publish to npm without 2 factor auth.
120+ run : npm publish --tag $NPM_DIST_TAG --workspaces --dry-run
113121
114122 # - name: Checkout firebolt GitHub.io repository
115- # if: steps.check_build.outputs.files_exists == 'true'
123+ # if: steps.check_build.outputs.result == 'true'
116124 # env:
117125 # GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }} # <-- Allows semantic-release-bot to push changes to protected branches
118126 # PRIVATE_KEY: ${{inputs.PRIVATE_KEY}}
119127 # run: |
120128 # cd /tmp
121- # git clone git@github.com:rdkcentral/ripple -doc.git ./firebolt-docs
129+ # git clone git@github.com:rdkcentral/lifecycle-manager -doc.git ./firebolt-docs
122130 # - name: Release docs to GitHub.io
123- # if: steps.check_build.outputs.files_exists == 'true' && (github.ref_name == 'main' || github.ref_name == 'next' || github.ref_name == 'next-major' || github.event_name == 'pull_request')
131+ # if: steps.check_build.outputs.result == 'true' && (github.ref_name == 'main' || github.ref_name == 'next' || github.ref_name == 'next-major' || github.event_name == 'pull_request')
124132 # env:
125133 # GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }} # <-- Allows semantic-release-bot to push changes to protected branches
126134 # run: |
0 commit comments