FFFF Update quarkus-next to use GitHub Packages for Quarkus snapshots by Pepo48 · Pull Request #47501 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content
Closed
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
11 changes: 11 additions & 0 deletions .github/quarkus-next-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>github-quarkus</id>
<username>${env.GITHUB_ACTOR}</username>
<password>${env.QUARKUS_PACKAGES_TOKEN}</password>
</server>
</servers>
</settings>
33 changes: 23 additions & 10 deletions .github/scripts/prepare-quarkus-next.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ set -xeuo pipefail
add_repository() {
local file=$1
local element=$2

local id="sonatype-snapshots"
local name="Sonatype Snapshots"
local url="https://central.sonatype.com/repository/maven-snapshots/"
local id=$3
local name=$4
local url=$5

# Decide the tag based on the element
local tag
Expand All @@ -33,8 +32,8 @@ add_repository() {

# Check if the tag exists in the file
if grep -q "<$tag>" "$file"; then
# Insert the element before the closing tag
sed -i "/<\/$tag>/i $repository" "$file"
# Insert the element before the closing tag (use sed substitution to handle same-line tags)
sed -i "s|</$tag>|$repository \n </$tag>|" "$file"
else
# If the tag doesn't exist, create it and insert the element
sed -i "/<\/project>/i \
Expand All @@ -46,12 +45,26 @@ add_repository() {

git checkout -b new-quarkus-next origin/main

add_repository "pom.xml" "repository"
add_repository "quarkus/pom.xml" "pluginRepository"
add_repository "operator/pom.xml" "pluginRepository"
# Sonatype for io.quarkus.platform:quarkus-bom
# GitHub Packages for io.quarkus:*
add_repository "pom.xml" "repository" "sonatype-snapshots" "Sonatype Snapshots" "https://central.sonatype.com/repository/maven-snapshots/"
add_repository "pom.xml" "repository" "github-quarkus" "Quarkus GitHub Packages Snapshots" "https://maven.pkg.github.com/quarkusio/quarkus"
add_repository "quarkus/pom.xml" "pluginRepository" "github-quarkus" "Quarkus GitHub Packages Snapshots" "https://maven.pkg.github.com/quarkusio/quarkus"
add_repository "operator/pom.xml" "pluginRepository" "github-quarkus" "Quarkus GitHub Packages Snapshots" "https://maven.pkg.github.com/quarkusio/quarkus"

# Point Maven to the GitHub Packages settings (PAT with read:packages scope)
sed -i -e '$a\' .mvn/maven.config 2>/dev/null || true
printf '%s\n' "-s" ".github/quarkus-next-settings.xml" >> .mvn/maven.config

./quarkus/set-quarkus-version.sh
git commit -am "Set quarkus version to 999-SNAPSHOT"

git add -A
git commit -m "Set quarkus version to 999-SNAPSHOT"

if ! git rev-parse --verify origin/quarkus-next &>/dev/null; then
echo "No existing quarkus-next branch found. Nothing to cherry-pick."
exit 0
fi

snapshot_version_hash=$(git log origin/quarkus-next --grep="Set quarkus version to 999-SNAPSHOT" --format="%H" -n 1)
commits_to_cherry_pick=$(git rev-list --right-only --no-merges --reverse new-quarkus-next...origin/quarkus-next | grep -vE "$snapshot_version_hash" || echo "")
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env:
SUREFIRE_RETRY: "-Dsurefire.rerunFailingTestsCount=2"
KC_TEST_GITHUB_SLOW_METHOD: "10"
KC_TEST_GITHUB_SLOW_CLASS: "60"
QUARKUS_PACKAGES_TOKEN: ${{ secrets.QUARKUS_PACKAGES_TOKEN }}

concurrency:
# Only cancel jobs for PR updates
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/operator-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

env:
MAVEN_ARGS: "-B -nsu -Daether.connector.http.connectionMaxTtl=25"
QUARKUS_PACKAGES_TOKEN: ${{ secrets.QUARKUS_PACKAGES_TOKEN }}
MINIKUBE_VERSION: v1.38.0
KUBERNETES_VERSION: v1.35.0
MINIKUBE_MEMORY: 4096 # Without explicitly setting memory, minikube uses ~25% of available memory which might be too little on smaller GitHub runners for running the tests
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/quarkus-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
- name: Cherry-pick additional commits in quarkus-next
run: |
${GITHUB_WORKSPACE}/.github/scripts/prepare-quarkus-next.sh
env:
QUARKUS_PACKAGES_TOKEN: ${{ secrets.QUARKUS_PACKAGES_TOKEN }}

- name: Push changes
run: |
Expand Down
Loading
0