Prepare for next release (#353) #35
Workflow file for this run
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: 'Update examples' | |
on: | |
push: | |
tags: [ '*' ] | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: 'Branch or tag' | |
required: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
update-examples: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Checkout' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- run: pip install -r .github/scripts/requirements.txt | |
- name: 'Get versions' | |
run: | | |
new="${{ inputs.ref || github.ref_name }}" | |
echo "Deleting '$new' in case it's alpha to stable bump." \ | |
"Git v:refname doesn't handle Maven version qualifiers correctly." | |
git tag -d "$new" | |
old="$(git tag --sort=-v:refname | head -n 1)" | |
echo "OLD_VERSION=$old" | tee -a $GITHUB_ENV | |
echo "NEW_VERSION=$new" | tee -a $GITHUB_ENV | |
- name: 'Update version in all files' | |
run: ./.github/scripts/replace_string.py ./ "$OLD_VERSION" "$NEW_VERSION" | |
- name: 'Create PR' | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
base: 'main' | |
branch: "replace-${{ env.OLD_VERSION }}-${{ env.NEW_VERSION }}" | |
title: "Bump examples and badges to ${{ env.NEW_VERSION }}" | |
author: "github-actions <[email protected]>" | |
committer: "github-actions <[email protected]>" | |
body: "Bump the version in examples and badges from ${{ env.OLD_VERSION }} to ${{ env.NEW_VERSION }}." |