Prepare Release Version #35
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
name: Prepare Release Version | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseVersion: | |
description: 'Version to release' | |
required: true | |
type: string | |
permissions: | |
contents: read | |
jobs: | |
update_release_version: | |
name: Initiate Release | |
if: github.repository == 'spring-projects/spring-pulsar' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
actions: read | |
steps: | |
- id: checkout-source | |
name: Checkout source code | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} | |
- name: Set up Gradle | |
uses: spring-io/spring-gradle-build-action@v2 | |
- id: check-open-issues | |
name: Check for open issues | |
run: | | |
echo "TODO actually check for open issues" | |
echo "is_open_issues=false" >> $GITHUB_OUTPUT | |
- id: validate-release-state | |
name: Validate release state | |
if: steps.check-open-issues.outputs.is_open_issues == 'true' | |
run: | | |
echo "There are open issues" | |
exit 1 | |
- id: update-version-and-push | |
name: Update version and push | |
if: steps.check-open-issues.outputs.is_open_issues == 'false' | |
env: | |
GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
releaseVersion="${{ inputs.releaseVersion }}" | |
releaseBranch="release-initiate/$releaseVersion" | |
git checkout -b $releaseBranch | |
./gradlew :updateToReleaseVersion -PreleaseVersion=$releaseVersion | |
git commit -am "[Release $releaseVersion] Update version" | |
git push origin $releaseBranch | |
gh pr create --title "[Release $releaseVersion] Update version" --body "Merge to initiate release." |