Skip to content

Commit f21c268

Browse files
committed
fix: update version output handling in npm publish workflow for nightly and regular versions
1 parent ca7c8ca commit f21c268

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/publish-npm-sdk.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,16 @@ jobs:
2626
if: github.event.inputs.tag == 'nightly'
2727
working-directory: packages/sdk
2828
run: |
29-
CURRENT_VERSION=$(npm pkg get version | tr -d '"')
30-
NIGHTLY_VERSION="${CURRENT_VERSION}-nightly-${GITHUB_SHA::7}"
31-
echo "NIGHTLY_VERSION=${NIGHTLY_VERSION}" >> $GITHUB_OUTPUT
29+
// if nightly tag
30+
if [ "${{ github.event.inputs.tag }}" == "nightly" ]; then
31+
CURRENT_VERSION=$(npm pkg get version | tr -d '"')
32+
NIGHTLY_VERSION="${CURRENT_VERSION}-nightly-${GITHUB_SHA::7}"
33+
echo "VERSION=${NIGHTLY_VERSION}" >> $GITHUB_OUTPUT
34+
else
35+
echo "VERSION=$(npm pkg get version | tr -d '"')" >> $GITHUB_OUTPUT
36+
fi
3237
outputs:
33-
NIGHTLY_VERSION: ${{ steps.set-publish-version.outputs.NIGHTLY_VERSION }}
38+
NIGHTLY_VERSION: ${{ steps.set-publish-version.outputs.VERSION }}
3439

3540
publish-npm:
3641
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@feat/publish-npm
@@ -42,7 +47,7 @@ jobs:
4247
environment: ${{ github.event.inputs.target }}
4348
working-directory: packages/sdk
4449
tag: ${{ github.event.inputs.tag }}
45-
version: ${{ needs.set-publish-version.outputs.NIGHTLY_VERSION }}
50+
version: ${{ needs.set-publish-version.outputs.VERSION }}
4651
install-command: |
4752
npm ci
4853
npm run codegen

0 commit comments

Comments
 (0)