Skip to content

Bump ⬆️ and release ✈️ a new library version #4

Bump ⬆️ and release ✈️ a new library version

Bump ⬆️ and release ✈️ a new library version #4

Workflow file for this run

name: "Bump ⬆️ and release ✈️ a new library version"
on:
workflow_dispatch:
inputs:
bumpType:
description: "Bump type"
required: true
default: "patch"
type: choice
options:
- patch
- minor
- major
env:
PYTHON_VERSION: 3.11
jobs:
release:
name: Bump ⬆️ and release ✈️ a new library version (${{ inputs.bumpType }})
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.CICD_PAT_TOKEN }}
- name: Configure Git user
run: |
git config --local user.name "Kraina CI/CD"
git config --local user.email "[email protected]"
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: pdm-project/setup-pdm@v3
name: Setup PDM (Python 3.11)
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64
- name: Install dependencies
run: pdm install -d -G dev --skip=post_install
- name: Run bumpver
run: |
pdm run bumpver update --${{ inputs.bumpType }} -vvv
- name: Get commit message
id: commit_message
run: |
git log -1 --pretty=%B | cat >> $COMMIT_MESSAGE
- name: Get new version
id: new_version
run: |
bumpver show -n -e | grep CURRENT_VERSION | cut -c 17- >> $semver_version
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
title: ${{ steps.commit_message.outputs.COMMIT_MESSAGE }}
branch: ${{ format('release-{0}', steps.new_version.outputs.semver_version) }}
labels: release