Bump temml-ruby #9
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
# SPDX-License-Identifier: CC0-1.0 | |
name: Bump temml-ruby | |
on: | |
workflow_dispatch: | |
jobs: | |
pr: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
ruby-version: '3.3' | |
- name: Extract version | |
id: extract-version | |
run: | | |
current_version="$(perl -ne "print \$1 if /(?<!TEMML_)VERSION = '(\d+\.\d+\.\d+)'/" lib/temml/version.rb)" | |
current_major="$(echo "$current_version" | cut -d . -f 1)" | |
current_minor="$(echo "$current_version" | cut -d . -f 2)" | |
current_patch="$(echo "$current_version" | cut -d . -f 3)" | |
next_version="$current_major.$((current_minor + 1)).$current_patch" | |
{ \ | |
echo "current_version=${current_version}"; \ | |
echo "next_version=${next_version}"; \ | |
} >> "$GITHUB_OUTPUT" | |
echo "current version: ${current_version}" | |
echo "next version: ${next_version}" | |
- name: Bump version | |
id: bump-version | |
run: | | |
bundle exec rake "bump[${{ steps.extract-version.outputs.next_version }}]" | |
- uses: peter-evans/create-pull-request@v5 | |
with: | |
commit-message: rake bump[${{ steps.extract-version.outputs.next_version }}] | |
branch: bump-to-${{ steps.extract-version.outputs.next_version }} | |
delete-branch: true | |
title: Bump to v${{ steps.extract-version.outputs.next_version }} | |
body: | | |
Bump to v${{ steps.extract-version.outputs.next_version }}. | |
Don't forget to execute the workflow! | |
[![lint and test](https://github.com/sudotac/temml-ruby/actions/workflows/lint-and-test.yml/badge.svg?branch=bump-to-${{ steps.extract-version.outputs.next_version }})](https://github.com/sudotac/temml-ruby/actions/workflows/lint-and-test.yml) | |
assignees: sudotac | |
reviewers: sudotac |