Merge pull request #41 from getyoti/release/DEP-460-3.0.1 #35
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: Publish Release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
registry-url: https://registry.npmjs.org/ | |
- run: yarn install | |
- run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
tag: | |
runs-on: ubuntu-latest | |
needs: deploy | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Add tag | |
run: | | |
CURRENT_VERSION=`cat package.json | grep "\"version\"" | sed "s/\s*\"version\"\s*:\s*\"\([0-9.]*\)\",/\1/g"` | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git tag -a v$CURRENT_VERSION -m "Version $CURRENT_VERSION deployed by Github Actions" | |
- name: Push tag | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
tags: true | |