Release Action #47
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: Release Action | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Release version (i.e. v1.2.3)' | |
required: true | |
type: string | |
jobs: | |
release: | |
name: Release Action | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/heads/main' }} | |
steps: | |
- uses: actions/checkout@v3 | |
name: Checkout Repository | |
with: | |
token: ${{ secrets.VIB_ACTION_TOKEN }} | |
- name: Set Node.js 20 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20.x | |
- name: Git config | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
- name: Release version | |
run: npm version --allow-same-version=true ${{ inputs.version }} -m "[AUTOMATED] Release version %s" | |
- name: Roll major tag | |
run: | | |
VERSION="${{ inputs.version }}" | |
VERSION_MAJOR="${VERSION%%\.*}" | |
git tag -f $VERSION_MAJOR ${{ inputs.version }} | |
- name: Push rolling major tag | |
run: git push --tags --force |