-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (48 loc) · 2 KB
/
bump-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# 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@v6
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