Prepare new 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: Prepare new release | |
on: | |
workflow_dispatch: | |
inputs: | |
versionBump: | |
description: "Type of version bump (major, minor, patch)" | |
required: true | |
default: "patch" | |
type: choice | |
options: | |
- "false" | |
- "minor" | |
- "patch" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-root | |
cancel-in-progress: true | |
jobs: | |
prepare_release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
uses: pnpm/action-setup@v4 | |
with: | |
run_install: true | |
- name: Build project | |
run: pnpm run build | |
- name: Set up Git | |
run: | | |
git config user.name "Aamir Azad" | |
git config user.email "[email protected]" | |
- name: Get tag | |
id: get_tag | |
run: | | |
git branch --show-current | |
git pull | |
echo "::set-output name=version::v$(pnpm pkg get version | tr -d '\"')" | |
- name: Tag the commit | |
run: | | |
next_version=${{ steps.get_tag.outputs.version }} | |
git tag -a "$next_version" -m "Version $next_version" | |
git push --follow-tags | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: ./build/* | |
tag_name: ${{ steps.get_tag.outputs.version }} | |
name: v${{ steps.get_tag.outputs.version }} | |
# Automatically generate release notes based on commits | |
generate_release_notes: true | |
draft: true | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |