bump version #1
This file contains hidden or 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
| # Manual bump workflow — choose level: patch, minor, or major. | |
| # Uses bumpver (configured in pyproject.toml) to create the commit + tag and push them. | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| level: | |
| description: "Which level to bump: patch, minor, or major" | |
| required: false | |
| default: "patch" | |
| permissions: | |
| contents: write | |
| jobs: | |
| bump: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| new_tag: ${{ steps.get_tag.outputs.new_tag }} | |
| steps: | |
| - name: Checkout (full history for tags) | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Install bumpver | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install bumpver | |
| - name: Configure git for pushing | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| # Use the passed-in secret to allow pushing and have events trigger if needed. | |
| git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git | |
| - name: Run bumpver (create commit + tag + push) | |
| run: | | |
| LEVEL="${{ inputs.level }}" | |
| if [ -z "$LEVEL" ]; then LEVEL="patch"; fi | |
| echo "Bumping level: $LEVEL" | |
| bumpver update --"$LEVEL" | |
| - name: Ensure tags are visible and capture the tag | |
| id: set_tag | |
| run: | | |
| git fetch --tags | |
| NEW_TAG=$(git describe --tags --abbrev=0) | |
| echo "Captured tag: $NEW_TAG" | |
| echo "new_tag=$NEW_TAG" >> $GITHUB_OUTPUT |