Skip to content

Merge pull request #29 from openstad/bugfix/always-set-publishDate-wh… #40

Merge pull request #29 from openstad/bugfix/always-set-publishDate-wh…

Merge pull request #29 from openstad/bugfix/always-set-publishDate-wh… #40

Workflow file for this run

name: build-dist
on:
push:
branches: ['master', 'release', 'development']
jobs:
publish-to-npm:
runs-on: ubuntu-latest
steps:
# init
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
# extract branch name
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5
# build dist
- run: npm run build-lib
# set version number
- run: npm run set-publish-version
env:
GITHUB_BRANCH_NAME: "${{ steps.branch-name.outputs.current_branch }}"
# npm publish
- run: npm publish --tag ${{ env.TAG_NAME }}
env:
TAG_NAME: "${{ ( steps.branch-name.outputs.current_branch == 'development' && 'alpha' ) || ( steps.branch-name.outputs.current_branch == 'release' && 'beta' ) || 'latest' }}"
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}