Skip to content

Commit 55998b7

Browse files
committed
npm publish: use a short git hash for npm version and no --tags anymore for npm publish
1 parent adf912f commit 55998b7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/push_dist_to_npm.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ jobs:
2323
- name: Build
2424
run: |
2525
npm --version
26-
npm version --git-tag-version=false 0.0.0-$(git rev-parse HEAD)
26+
# GHVERSION=0.0.0-$(git rev-parse HEAD)
27+
GHVERSION=0.0.0-$(git rev-parse --short=8 HEAD)
28+
npm version --git-tag-version=false $GHVERSION
2729
# limit distribution to the dist folder (just for this build), and set package name
2830
node -e "const packageJson=require('./package.json'); packageJson.files=['dist/']; packageJson.name='@graphhopper/graphhopper-maps-bundle'; require('fs').writeFileSync('package.json', JSON.stringify(packageJson, null, 4));"
2931
npm ci
3032
npm run build
3133
# no dependencies or scripts in package.json (they should not be installed when installing the package, because they are all included in the bundle already)
3234
node -e "const packageJson=require('./package.json'); packageJson.scripts={}; packageJson.dependencies={}; packageJson.devDependencies={}; require('fs').writeFileSync('package.json', JSON.stringify(packageJson, null, 4));"
3335
# we need to set the access to public, because organization scoped packages are private by default
34-
npm publish --access public --tag 0.0.0-$(git rev-parse HEAD)
36+
npm publish --access public

0 commit comments

Comments
 (0)