Skip to content

Bump And Publish

Bump And Publish #80

Workflow file for this run

name: Bump And Publish
on:
workflow_dispatch:
inputs:
yarnVersionArgs:
description: 'Arguments for "yarn version"'
required: true
default: '--patch'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn
- run: yarn test
- name: Setup GIT
run: |
git reset --hard
git config --local --list
git checkout master
git config user.email "$GH_EMAIL"
git config user.name "$GH_USER"
env:
GH_EMAIL: ${{secrets.GH_EMAIL}}
GH_USER: ${{secrets.GH_USER}}
- name: Bump version
run: |
git reset --hard
yarn version --no-git-tag-version ${{ github.event.inputs.yarnVersionArgs }}
export NEW_RELEASE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
echo New Release Version is: [$NEW_RELEASE_VERSION]
yarn build
yarn test
git add . || true
git commit -m "Release v$NEW_RELEASE_VERSION" || true
git tag -a "v$NEW_RELEASE_VERSION" -m "Release v$NEW_RELEASE_VERSION"
git push "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY"
git push "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY" --tags
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: npm publish
run: |
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
npm publish
env:
NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}