Prepare Vivid for release #186
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: Prepare Vivid for release | |
permissions: | |
contents: read | |
packages: read | |
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 }} | |
- name: Use Node.js 14 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 14 | |
registry-url: https://npm.pkg.github.com | |
- name: Install yarn | |
run: npm install -g yarn | |
- name: Install dependencies | |
run: yarn install --network-timeout 100000 | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
# 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 |