Skip to content

release

release #18

Workflow file for this run

name: 'release'
on:
workflow_dispatch:
inputs:
bump:
description: 'Semver version to bump'
required: true
type: choice
options:
- patch
- minor
- major
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.REPO_GHA_PAT }}
- uses: actions/setup-node@v3
with:
node-version: '16'
- run: npm install
- run: npm run all --workspaces
- id: bump-version
run: npm version ${{ github.event.inputs.bump }} --no-git-tag-version
- id: get-version
run: |
VERSION=$(node -pe "require('./package.json')['version']")
MAJOR=$(node -pe "require('./package.json')['version'].split('.')[0]")
MINOR=$(node -pe "require('./package.json')['version'].split('.').slice(0, 2).join('.')")
echo ::set-output name=version::$VERSION
echo ::set-output name=major::$MAJOR
echo ::set-output name=minor::$MINOR
- uses: EndBug/add-and-commit@v9
with:
add: 'package.json package-lock.json'
default_author: github_actor
message: 'Bump to v${{ steps.get-version.outputs.version }}'
push: true
- uses: EndBug/add-and-commit@v9
id: commit
with:
add: '*/dist/* --force'
remove: './node_modules/*'
default_author: github_actor
message: 'Release v${{ steps.get-version.outputs.version }}'
push: false
- uses: rickstaa/action-create-tag@v1
with:
tag: 'latest'
commit_sha: ${{ steps.commit.outputs.commit_long_sha }}
force_push_tag: true
- uses: rickstaa/action-create-tag@v1
with:
tag: 'v${{ steps.get-version.outputs.major }}'
commit_sha: ${{ steps.commit.outputs.commit_long_sha }}
force_push_tag: true
- uses: rickstaa/action-create-tag@v1
with:
tag: 'v${{ steps.get-version.outputs.minor }}'
commit_sha: ${{ steps.commit.outputs.commit_long_sha }}
force_push_tag: true
- uses: rickstaa/action-create-tag@v1
with:
tag: 'v${{ steps.get-version.outputs.version }}'
commit_sha: ${{ steps.commit.outputs.commit_long_sha }}
force_push_tag: true