Bump the version #47
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
name: Bump the version | |
on: | |
workflow_dispatch: | |
inputs: | |
bumpLevel: | |
description: "Kind of version bump for project" | |
required: true | |
default: "patch" | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
- client | |
bumpClient: | |
description: "Bump supported client?" | |
required: true | |
type: boolean | |
newClientVersion: | |
description: "Version of new client (needed to bump supported client)" | |
required: true | |
default: "0.0.0" | |
type: string | |
permissions: | |
contents: read | |
jobs: | |
bumpversion: | |
name: Bump the package version | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install package | |
run: | | |
set -eux | |
pip install --disable-pip-version-check -e "."[cicd,client,server,developer] | |
- name: Run bumpversion and push tag | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.name "DiamondLightSource-build-server" | |
git config --global user.email "DiamondLightSource-build-server@users.noreply.github.com" | |
git config credential.helper "store --file=.git/credentials" | |
echo "https://${GITHUB_TOKEN}:@github.com" > .git/credentials | |
echo "##[section]Creating commit on branch 'version-bump'" | |
git checkout -b version-bump | |
if [[ ${{ inputs.bumpClient }} == true && ${{ inputs.newClientVersion }} != "0.0.0" ]]; then | |
bump-my-version bump --config-file .bumpclient.toml --new-version ${{ inputs.newClientVersion }} | |
fi | |
if [ ${{ inputs.bumpLevel }} != "client" ]; then | |
bump-my-version bump ${{ inputs.bumpLevel }} | |
fi | |
echo "##[section]Creating pull request" | |
git push -f --set-upstream origin version-bump | |
gh pr create -B main -H version-bump -t "Version update (${{ inputs.bumpLevel }})" -b " | |
This is an automated pull request to update the version. | |
Bumped supported client client version: ${{ inputs.bumpClient }} | |
If true, the supported client version is now: ${{ inputs.newClientVersion }} | |
After merging this, the \`Publish version\` action will tag this release and publish to pypi. | |
" | |
echo |