Skip to content

Prepare Release Pull Request #1

Prepare Release Pull Request

Prepare Release Pull Request #1

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