Add workflow to bump the version (#203)

Signed-off-by: Ryan McCue <me@ryanmccue.info>
This commit is contained in:
Ryan McCue 2025-07-30 19:40:03 +01:00 committed by GitHub
parent 0cbb4f223e
commit 2bd1363345
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

39
.github/workflows/bump-version.yml vendored Normal file
View file

@ -0,0 +1,39 @@
name: Bump version for release
on:
workflow_dispatch:
inputs:
version:
description: 'New version being released (e.g. "1.0.0")'
required: true
type: string
jobs:
log-the-inputs:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Bump version
run: |
# Replace the "Version:" header in plugin.php
sed -i "s/^Version: .*/Version: ${{ inputs.version }}/" plugin.php
# Replace the VERSION const in plugin.php
sed -i "s/^const VERSION = '.*/const VERSION = '${{ inputs.version }}';/" plugin.php
echo "Bumped version to ${{ inputs.version }}"
env:
VERSION: ${{ inputs.version }}
- name: Create pull request
uses: peter-evans/create-pull-request@v7
with:
branch: bump-version
commit-message: "Bump version to ${{ inputs.version }}"
title: "[bump-version] Bump version to ${{ inputs.version }}"
body: "Bump version to ${{ inputs.version }}. Triggered by ${{ github.triggering_actor }}."
base: main
signoff: true
delete-branch: true