Skip to content

Create Release Transition PR #1

Create Release Transition PR

Create Release Transition PR #1

name: Create Release Transition PR
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to transition'
required: false
default: 'main'
newVersion:
description: 'New Version'
required: true
default: '0.0.1-SNAPSHOT'
transition:
type: choice
description: Choose
options:
- DEVELOPMENT_TO_RELEASE
- RELEASE_TO_DEVELOPMENT
jobs:
create-transition-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Update Sources
run: |
if [[ "${{ github.event.inputs.transition }}" == "DEVELOPMENT_TO_RELEASE" ]]; then
# integration.yaml will push up a matching image tag after Releaser pushes up the v${newVersion} tag
IMAGE_TAG="${{ github.event.inputs.newVersion }}"
else
# integration.yaml will push images to quay tagged with the branch name on push to branch
IMAGE_TAG="${{ github.event.inputs.branch }}"
fi
.github/scripts/setVersions.sh "${{ github.event.inputs.newVersion }}" $IMAGE_TAG
- name: Test maven build
run: mvn -B clean verify
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Test Build Image
uses: docker/build-push-action@v6
with:
context: data-generator/
platforms: linux/amd64,linux/arm64
push: false
file: data-generator/Dockerfile
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
# use token so that the created PR will trigger other actions, default GITHUB_TOKEN does not do this
token: ${{ secrets.RELEASE_TOKEN }}
commit-message: "Update to ${{ github.event.inputs.newVersion }}"
branch: "transition-${{ github.event.inputs.branch }}-${{ github.event.inputs.newVersion }}"
signoff: true
title: "Release Transition ${{ github.event.inputs.branch }} from ${{ github.event.inputs.transition }}: ${{github.event.inputs.newVersion}}"
body: "Release Transition ${{ github.event.inputs.branch }} from ${{ github.event.inputs.transition }}: ${{github.event.inputs.newVersion}}"
labels: release