Skip to content

Prepare Next Development Iteration #25

Prepare Next Development Iteration

Prepare Next Development Iteration #25

name: Prepare Next Development Iteration
on:
workflow_dispatch:
inputs:
nextVersion:
description: Version number of the next iteration (e.g. 8.4-SNAPSHOT)
required: true
jobs:
Next-Iteration-Job:
name: Next Iteration Job
runs-on: github-ubuntu-latest-s
permissions:
pull-requests: write
contents: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEXT_VERSION: ${{ inputs.nextVersion }}
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Update Version Number
id: update-version
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global core.autocrlf input
git config --global core.safecrlf true
BRANCH="gh-action/next-iteration.${{ github.run_id }}"
git checkout -b "${BRANCH}"
mvn versions:set -DgenerateBackupPoms=false -DnewVersion="${NEXT_VERSION}"
git commit -m 'Prepare next development iteration' -a
git push --set-upstream origin "${BRANCH}"
echo "branch=${BRANCH}" >> $GITHUB_OUTPUT
- name: Create Pull Request
id: create-pr
run: |
URL=$(gh pr create --base master --title "Prepare next development iteration ${NEXT_VERSION}" --body '')
echo "url=${URL}" >> $GITHUB_OUTPUT
- name: Trigger Continuous Integration
run: |
gh pr close ${{steps.create-pr.outputs.url}}
gh pr reopen ${{steps.create-pr.outputs.url}}
- name: Summary
run: |
echo "Generated ${{steps.create-pr.outputs.url}}." >> $GITHUB_STEP_SUMMARY
echo "New version set to ${NEXT_VERSION}." >> $GITHUB_STEP_SUMMARY
echo "Tip: close and reopen the PR to trigger CI. " >> $GITHUB_STEP_SUMMARY