Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add manual trigger to bump the versions accordingly #98

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/manual_release_trigger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Prepare release manually

on:
workflow_dispatch:
inputs:
release:
description: 'Type of release'
required: true
type: choice
options:
- 'MAJOR'
- 'MINOR'
- 'PATCH'
default: 'PATCH'

jobs:
bump-versions:

name: Bump versions and tag
runs-on: ubuntu-latest
permissions:
contents: write

steps:

- uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
.github
ci
src
pyproject.toml
requirements.txt

- name: Determine new versions
run: |
echo "release_version=$(./ci/version_determiner.py release-version $release_type)" >> "$GITHUB_ENV"
echo "version_tag=$(./ci/version_determiner.py version-tag $release_type)" >> "$GITHUB_ENV"
echo "snapshot_version=$(./ci/version_determiner.py snapshot-version $release_type)" >> "$GITHUB_ENV"
env:
release_type: ${{ inputs.release }}

- name: Print new versions
run: |
echo "Release version: $release_version"
echo "Version tag: $version_tag"
echo "Snapshot version: $snapshot_version"

- name: Configure Git user
run: |
git config user.email "actions+bumper@users.noreply.github.com"
git config user.name "GitHub Actions Bumper"

- name: Bump to release version and tag
run: |
./ci/version_writer.py $release_version
git commit --all --message "Bump version to $release_version"
git tag --annotate --message "Release $version_tag" $version_tag

- name: Bump to snapshot version
run: |
./ci/version_writer.py $snapshot_version
git commit --all --message "Bump version to $snapshot_version"

- name: Push version changes and tag
uses: ad-m/github-push-action@master
with:
tags: true