Create release #3
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: Create release | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "Git tag value in sem ver" | |
required: true | |
type: string | |
env: | |
NODE_VERSION: latest | |
GIT_MAIN_BRANCH: main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.GIT_MAIN_BRANCH }} | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Set up Git user | |
uses: fregante/setup-git-user@v2 | |
- name: Get release version | |
id: version | |
run: echo "VALUE=$(npx --yes semver ${{ github.event.inputs.tag }})" >> "$GITHUB_OUTPUT" | |
- name: Update project version | |
run: | | |
npm version ${{ steps.version.outputs.VALUE }} --no-git-tag-version | |
git add package.json | |
git commit -m "chore: release ${{ steps.version.outputs.VALUE }}" | |
git push | |
git tag ${{ steps.version.outputs.VALUE }} | |
git push origin ${{ steps.version.outputs.VALUE }} |