Skip to content

version

version #19

Workflow file for this run

name: version
on:
workflow_dispatch:
jobs:
version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Set Git user
run: |
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
- name: Set variables
run: |
echo "CURRENT_VERSION=$(jq -r .version lerna.json)" >> $GITHUB_ENV
echo "LAST_MINOR=$((npm --silent info ern-core version || echo '0.0.0') | cut -d '.' -f 2)" >> $GITHUB_ENV
- run: yarn --frozen-lockfile
- name: Minor version
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
run: |
git checkout -b v0.$((LAST_MINOR+1))
git push -u origin v0.$((LAST_MINOR+1))
yarn lerna version 0.$((LAST_MINOR+1)).0 -y --exact --force-publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Patch version
if: startsWith(env.CURRENT_VERSION, '0.')
run: yarn lerna version patch -y --exact --force-publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: echo "VERSION=$(jq -r .version lerna.json)" >> $GITHUB_ENV
- run: gh release create v$VERSION -d --generate-notes -t $VERSION
env:
GH_TOKEN: ${{ github.token }}