Upgrade version #6
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: Upgrade version | |
on: | |
workflow_dispatch: | |
inputs: | |
version_type: | |
type: choice | |
description: "Version bump type" | |
required: true | |
options: | |
- "patch" | |
- "minor" | |
- "major" | |
jobs: | |
upgrade: | |
name: Upgrade version | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🔄 Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.TOKEN }} | |
- name: 🐍 Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: 📦 Upgrade version | |
run: python version-upgrade.py ${{ github.event.inputs.version_type }} | |
working-directory: .github/scripts | |
- name: 🏷️ Extract new version number | |
id: version_extraction | |
run: | | |
NEW_VERSION=$(grep '"version":' manifest.json | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") | |
echo "NEW_VERSION=$NEW_VERSION" >> "$GITHUB_OUTPUT" | |
echo "New version: $NEW_VERSION" | |
- name: 🤖 Commit and push | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
env: | |
NEW_VERSION: ${{ steps.version_extraction.outputs.NEW_VERSION }} | |
with: | |
commit_message: Upgrade to version ${{ env.NEW_VERSION }} | |
tagging_message: "v${{ env.NEW_VERSION }}" |