-
Notifications
You must be signed in to change notification settings - Fork 42
53 lines (48 loc) · 1.81 KB
/
prepare-release-pull-request.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
50
51
52
53
name: Prepare Release Pull Request
on:
workflow_dispatch:
inputs:
next-version:
description: 'The next version to create a pull request for'
required: true
type: string
jobs:
create_release_pull_request:
runs-on: ubuntu-latest
environment: production
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/[email protected]
- name: Bump Version Name In Source
env:
NEXT_VERSION: ${{ inputs.next-version }}
run: |
currentVersionName=$(
cat ./scratchoff/publishing.gradle \
| grep 'mavLibraryVersion = "' \
| sed -E 's/.*mavLibraryVersion = *"([0-9\.]+)".*$/\1/'
)
sed -i -e "s/mavLibraryVersion = \"${currentVersionName}\"/mavLibraryVersion = \"${NEXT_VERSION}\"/g" ./scratchoff/publishing.gradle
sed -i -e "s/com.jackpocket:scratchoff:${currentVersionName}/com.jackpocket:scratchoff:${NEXT_VERSION}/g" ./readme.md
- name: Build Changelog for PR body
id: build_changelog
uses: mikepenz/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
configuration: ".github/changelog_config.json"
toTag: ${{ github.sha }}
- name: Create Pull Request with changes
uses: peter-evans/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: main
title: Bumps Version to ${{ inputs.next-version }}
branch: bump-version-${{ inputs.next-version }}
body: ${{ steps.build_changelog.outputs.changelog }}
commit-message: Auto-Bump Version to ${{ inputs.next-version }}
add-paths: |
./scratchoff/publishing.gradle
./readme.md