Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move Quarkus platform PR info to the project.yml file #1026

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ name: Java Operator SDK Extension
release:
current-version: 7.0.0.CR1
next-version: 7.0.0-SNAPSHOT

quarkus-platform-branches:
- "main"
- "3.17"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@metacosm these don't need to be strings, but otherwise we will get warnings that we mix strings and numbers. I mean, it can also be without quotes like this if preferred:

  quarkus-platform-branches:
    - main
    - 3.17

16 changes: 9 additions & 7 deletions .github/workflows/release-quarkus-platform-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,32 @@ on:
qosdk-version:
type: string
required: true
quarkus-platform-branch:
quarkus-platform-branches:
type: string
required: false
default: 'main'
required: true
secrets:
qosdk-bot-token:
required: true

jobs:
quarkus-platform-pr:
runs-on: ubuntu-latest
strategy:
matrix:
quarkus-platform-branch: ${{ fromJson(inputs.quarkus-platform-branches) }}
steps:
- uses: actions/checkout@v4
with:
repository: quarkusio/quarkus-platform
ref: ${{inputs.quarkus-platform-branch}}
ref: ${{matrix.quarkus-platform-branch}}

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'

- name: Update QOSDK version to ${{inputs.qosdk-version}} in quarkus-platform ${{inputs.quarkus-platform-branch}}
- name: Update QOSDK version to ${{inputs.qosdk-version}} in quarkus-platform ${{matrix.quarkus-platform-branch}}
run: |
./mvnw -B versions:set-property -Dproperty=quarkus-operator-sdk.version -DnewVersion=${{inputs.qosdk-version}}
./mvnw -Dsync
Expand All @@ -38,11 +40,11 @@ jobs:
uses: peter-evans/create-pull-request@v7
id: qp-pr
with:
title: "Update QOSDK to ${{inputs.qosdk-version}} for ${{inputs.quarkus-platform-branch}}"
title: "Update QOSDK to ${{inputs.qosdk-version}} for ${{matrix.quarkus-platform-branch}}"
commit-message: "Update QOSDK to ${{inputs.qosdk-version}}"
committer: metacosm <[email protected]>
author: metacosm <[email protected]>
branch: qosdk-release-${{inputs.qosdk-version}}-${{inputs.quarkus-platform-branch}}
branch: qosdk-release-${{inputs.qosdk-version}}-${{matrix.quarkus-platform-branch}}
token: ${{ secrets.qosdk-bot-token }}
push-to-fork: qosdk-bot/quarkus-platform
delete-branch: true
Expand Down
58 changes: 13 additions & 45 deletions .github/workflows/release-update-quarkus-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,44 +24,22 @@ jobs:

outputs:
released: ${{steps.wait-for-bom.outputs.published}}
quarkus-platform-branch: ${{steps.versions.outputs.quarkus_platform_branch}}
needs-main-pr: ${{ steps.versions.outputs.needs_main_pr == 'true' }}
quarkus-platform-branches: ${{steps.qosdk-metadata.outputs.quarkus_platform_branches}}

steps:
- uses: actions/checkout@v4
- uses: radcortez/project-metadata-action@main
name: Retrieve project metadata
id: metadata
with:
ref: ${{github.event.inputs.tag || github.ref_name}}
github-token: ${{secrets.GITHUB_TOKEN}}
metadata-file-path: '.github/project.yml'
local-file: true

- name: Gather versions
id: versions
- name: Parse QOSDK metadata
id: qosdk-metadata
run: |
quarkus_version=$(./mvnw help:evaluate -Dexpression=quarkus.version -q -DforceStdout)
quarkus_major=$(echo ${quarkus_version} | cut -d . -f 1,2)
echo "QOSDK-defined Quarkus version: ${quarkus_version} (-> major: ${quarkus_major})"

quarkus_platform_version=$(curl -s https://registry.quarkus.io/client/platforms | jq -r '.platforms[0]."current-stream-id"')
echo "Current platform-defined Quarkus major version: ${quarkus_platform_version}"

quarkus_platform_branch=${quarkus_major}
if [ "${quarkus_major}" = "${quarkus_platform_version}" ]; then
quarkus_platform_branch="${quarkus_platform_version}"
fi
echo "quarkus_platform_branch=${quarkus_platform_branch}" >> $GITHUB_OUTPUT

if [ "${quarkus_platform_branch}" = "main" ]; then
echo "quarkus-platform update will target main"
echo "need_main_pr=true" >> $GITHUB_OUTPUT
else
echo "quarkus-platform update will target ${quarkus_platform_branch}"
echo "Check if quarkus-platform also needs to be updated on main"
if [ "${{ github.base_ref }}" = "main" ]; then
echo "PR targets main so assume quarkus-platform main also needs to be updated"
echo "need_main_pr=true" >> $GITHUB_OUTPUT
else
echo "No need for PR on quarkus-platform main"
echo "need_main_pr=false" >> $GITHUB_OUTPUT
fi
fi
quarkus_platform_branches=$(echo '${{steps.metadata.outputs.json}}' | jq -c '.release.["quarkus-platform-branches"]')
echo "quarkus_platform_branches=${quarkus_platform_branches}" >> $GITHUB_OUTPUT

- name: Wait for QOSDK BOM to be published
uses: quarkusio/monitor-artifact-publication-action@main
Expand All @@ -76,22 +54,12 @@ jobs:
poll-iterations: 10
post-delay: 0

update-quarkus-platform-branch:
quarkus-platform-branch-pull-requests:
uses: ./.github/workflows/release-quarkus-platform-pr.yml
needs:
- prepare-platform-pr
with:
qosdk-version: ${{github.event.inputs.tag || github.ref_name}}
quarkus-platform-branch: ${{needs.prepare-platform-pr.outputs.quarkus-platform-branch}}
quarkus-platform-branches: ${{needs.prepare-platform-pr.outputs.quarkus-platform-branches}}
secrets:
qosdk-bot-token: ${{ secrets.QOSDK_BOT_TOKEN }}

update-quarkus-platform-main-if-needed:
needs:
- prepare-platform-pr
if: ${{ needs.prepare-platform-pr.outputs.needs-main-pr && needs.prepare-platform-pr.outputs.quarkus-platform-branch != 'main' }}
uses: ./.github/workflows/release-quarkus-platform-pr.yml
with:
qosdk-version: ${{github.event.inputs.tag || github.ref_name}}
secrets:
qosdk-bot-token: ${{ secrets.QOSDK_BOT_TOKEN }}
Loading