Merge pull request #14 from seald/fix-publish-label

fix publish label
pull/15/head
arantes555 3 years ago committed by GitHub
commit e3f4ee8783
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/workflows/publish.yml

@ -15,7 +15,7 @@ jobs:
- run: npm ci - run: npm ci
- run: npm run prepublishOnly - run: npm run prepublishOnly
- id: get_npm_label - id: get_npm_label
run: if (npx semver ${{ github.event.release.tag_name }} --range '>0.0.0'); then echo ::set-output name=NPM_LABEL::latest; else echo ::set-output name=NPM_LABEL::beta; fi; # Using the fact that semver by default considers that pre-releases do not respect stable ranges run: if (npx semver $(node -p "require('./package.json').version") --range '>0.0.0'); then echo ::set-output name=NPM_LABEL::latest; else echo ::set-output name=NPM_LABEL::beta; fi; # Using the fact that semver by default considers that pre-releases do not respect stable ranges
- run: npm publish --tag=${NPM_LABEL} --access public - run: npm publish --tag=${NPM_LABEL} --access public
env: env:
NPM_LABEL: ${{ steps.get_npm_label.outputs.NPM_LABEL }} NPM_LABEL: ${{ steps.get_npm_label.outputs.NPM_LABEL }}

Loading…
Cancel
Save