Skip to content

Prepare Vivid for release #184

Prepare Vivid for release

Prepare Vivid for release #184

name: Prepare Vivid for release
on:
workflow_dispatch:
inputs:
version:
description: 'Version to bump to'
required: false
jobs:
prepare-verify:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
token: ${{ secrets.VNG_VVD_PAT }}
- run: printf "registry=https://npm.pkg.github.com/Vonage\n_authToken=\${GITHUB_TOKEN}\n//npm.pkg.github.com/:_authToken=\${GITHUB_TOKEN}\nalways-auth=true" > .npmrc
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
- name: Install yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install --network-timeout 100000
# Update to a new version
- name: Extract release version manually set
if: ${{ github.event.inputs.version }}
run: echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
- name: Obtain release version if not manually set
if: ${{ !(env.RELEASE_VERSION) }}
run: echo "RELEASE_VERSION=$(node ./scripts/suggest-bump.mjs)" >> $GITHUB_ENV
- name: Bump version to ${{ env.RELEASE_VERSION }}
run: |
yarn lerna version ${{ env.RELEASE_VERSION }} --force-publish --no-git-tag-version --no-push --exact --yes
yarn changelog
# Build & Test with new version
- name: Build components
run: yarn compile
- name: Lint sources
run: yarn lint
- name: Test components
run: yarn test:prepublish
# Push updated/created content to remote and Tag version
- name: Push changes
run: |
git fetch
git config user.email "[email protected]"
git config user.name "Vivid"
git add --all
git commit -m "update versions to ${{ env.RELEASE_VERSION }}"
git push
- name: Tag release
run: |
git tag -a v${{ env.RELEASE_VERSION }} -m "tag release v${{ env.RELEASE_VERSION }}"
git push --follow-tags