Skip to content

Create a release

Create a release #2

Workflow file for this run

name: Create a release
on:
workflow_dispatch:
inputs:
version:
type: choice
description: 'Version to bump'
required: true
options:
- 'patch'
- 'minor'
- 'major'
tag:
type: choice
description: 'Tag'
required: true
options:
- 'alpha'
- 'beta'
- 'latest'
jobs:
release:
name: Release new version
runs-on: ubuntu-latest
outputs:
new_tag: ${{ steps.bump_verson.outputs.tag }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- id: bump_verson
run: npm version ${{ inputs.version }} >> "$GITHUB_OUTPUT"
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
git push --follow-tags
github_release:
name: Create a release
runs-on: ubuntu-latest
needs: release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- run: gh release create ${{ needs.release.outputs.new_tag }} --draft --verify-tag