Skip to content

Release

Release #206

Workflow file for this run

name: Release
on: [workflow_dispatch]
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# pulls all commits (needed for lerna / semantic release to correctly version)
fetch-depth: 0
- name: Setup Nodejs Env
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
# pulls all tags (needed for lerna / semantic release to correctly version)
- name: Pull All Git Tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- uses: fregante/setup-git-user@v1
- name: Setup Nodejs
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VER }}
# lerna expects to be authenticated for publishing to NPM. This step will fail CI if NPM is not authenticated
- name: Check NPM authentication
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}" >> .npmrc
npm whoami
- name: Install and Setup Dependencies
run: npm ci
# build must come before running linting and tests for the `dist` directory to exist.
- name: Build
run: npm run build
- name: Lint
run: npm run lint
- name: Test
run: npm run test
- name: Coverage Report
uses: codecov/codecov-action@v3
- name: Update automation/lerna/version branch
run: |
git switch -C automation/lerna/version
git reset --hard origin/master
- name: Push the updated branch automation/lerna/version
run: |
git push -f origin automation/lerna/version
- name: Increment Versions of Changed Packages
run: |
npx lerna@6 version --yes --allow-branch automation/lerna/version --git-remote origin --conventional-commits --create-release github
git status
git push --set-upstream origin automation/lerna/version
git push origin --tags
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Lerna Versions PR
id: vpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "chore(release): publish :tada:"
body: |
chore(release): publish :tada:
branch: automation/lerna/version
base: master
- name: Enable Lerna Versions PR Pull Request Automerge
if: steps.vpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
pull-request-number: ${{ steps.vpr.outputs.pull-request-number }}
merge-method: squash