7979
8080 - name : Set package version
8181 working-directory : ${{ env.WORKING_DIR }}
82- shell : bash
83- run : |
84- npm version "$VERSION" --no-git-tag-version --allow-same-version
85- env :
86- VERSION : ${{ inputs.version }}
82+ run : npm version ${{ inputs.version }} --no-git-tag-version --allow-same-version
8783
8884 - name : Install musl tools
8985 if : contains(matrix.target, 'musl')
@@ -118,6 +114,11 @@ jobs:
118114 cache : ' npm'
119115 cache-dependency-path : ' src/js-host-api/package-lock.json'
120116
117+ - name : Validate version format
118+ run : npx --yes semver "$VERSION" >/dev/null 2>&1 || { echo "Invalid version: $VERSION"; exit 1; }
119+ env :
120+ VERSION : ${{ inputs.version }}
121+
121122 - name : Install dependencies
122123 working-directory : ${{ env.WORKING_DIR }}
123124 run : npm ci --ignore-scripts --omit=optional
@@ -189,7 +190,7 @@ jobs:
189190 working-directory : ${{ env.WORKING_DIR }}
190191 run : |
191192 # napi prepublish generates index.js and index.d.ts from the .node artifacts
192- npx napi prepublish -t npm --skip-gh-release
193+ npx --no-install napi prepublish -t npm --skip-gh-release
193194 ls -la index.js index.d.ts
194195
195196 - name : Publish Linux GNU package
@@ -236,4 +237,4 @@ jobs:
236237 npm pack ./npm/win32-x64-msvc --dry-run
237238 echo ""
238239 echo "--- @hyperlight/js-host-api ---"
239- npm pack --dry-run
240+ npm pack --dry-run
0 commit comments