The JavaScript Database, for Node.js, nw.js, electron and the browser
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nedb/.github/workflows/publish.yml

23 lines
837 B

3 years ago
name: Publish Package
on:
push:
tags:
- '*'
3 years ago
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18.x'
3 years ago
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run prepublishOnly
- id: get_npm_label
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
3 years ago
- run: npm publish --tag=${NPM_LABEL} --access public
env:
NPM_LABEL: ${{ steps.get_npm_label.outputs.NPM_LABEL }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}