Merge pull request #29 from openstad/bugfix/always-set-publishDate-wh… #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |