From 8c3643b9ca432fe1d52b5dd3838b89fbba20c32d Mon Sep 17 00:00:00 2001 From: Radovan Synek Date: Thu, 25 Jun 2026 16:07:26 +0200 Subject: [PATCH 1/3] ci: add JFrog credentials to downstream build workflow Added JFrog credentials for downloading parent pom.xml to upgrade models' version to solver snapshot. --- .github/workflows/downstream_build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/downstream_build.yml b/.github/workflows/downstream_build.yml index 4733cc4d7a..1e00f5b129 100644 --- a/.github/workflows/downstream_build.yml +++ b/.github/workflows/downstream_build.yml @@ -93,6 +93,10 @@ jobs: java-version: '21' distribution: 'temurin' cache: 'maven' + # Set the JFrog credentials that will be used for downloading the solver service parent in the downstream build. + server-id: timefold + server-username: JRELEASER_JFROG_USERNAME + server-password: JRELEASER_JFROG_TOKEN - name: Quickly build timefold-solver working-directory: ./timefold-solver From 2fbf661eb0b7f5ac07caaca5987743fcfe7536b9 Mon Sep 17 00:00:00 2001 From: rsynek Date: Thu, 25 Jun 2026 17:11:30 +0200 Subject: [PATCH 2/3] ci: inherit secrets from parent workflow --- .github/workflows/downstream_build.yml | 2 ++ .github/workflows/pull_request_secure_downstream.yml | 12 +++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/downstream_build.yml b/.github/workflows/downstream_build.yml index 1e00f5b129..b6dee5f926 100644 --- a/.github/workflows/downstream_build.yml +++ b/.github/workflows/downstream_build.yml @@ -115,6 +115,8 @@ jobs: shell: bash env: TIMEFOLD_LICENSE: ${{ secrets.TIMEFOLD_SOLVER_CI_PROD_LICENSE }} + JRELEASER_JFROG_USERNAME: ${{ secrets.JRELEASER_JFROG_USERNAME }} + JRELEASER_JFROG_TOKEN: ${{ secrets.JRELEASER_JFROG_TOKEN }} run: | mvn versions:update-parent -DskipResolution=true -DallowSnapshots=true -DparentVersion=999-SNAPSHOT mvn -B clean verify diff --git a/.github/workflows/pull_request_secure_downstream.yml b/.github/workflows/pull_request_secure_downstream.yml index 3b2fd517dd..c216e9a31d 100644 --- a/.github/workflows/pull_request_secure_downstream.yml +++ b/.github/workflows/pull_request_secure_downstream.yml @@ -72,9 +72,7 @@ jobs: name: Field Service Routing head_ref: ${{ github.head_ref }} head_sha: ${{ github.event.pull_request.head.sha }} - secrets: - JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }} - TIMEFOLD_SOLVER_CI_PROD_LICENSE: ${{ secrets.TIMEFOLD_SOLVER_CI_PROD_LICENSE }} + secrets: inherit timefold-employee-scheduling: needs: approval_required @@ -84,9 +82,7 @@ jobs: name: Employee Scheduling head_ref: ${{ github.head_ref }} head_sha: ${{ github.event.pull_request.head.sha }} - secrets: - JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }} - TIMEFOLD_SOLVER_CI_PROD_LICENSE: ${{ secrets.TIMEFOLD_SOLVER_CI_PROD_LICENSE }} + secrets: inherit timefold-pickup-delivery-routing: needs: approval_required @@ -96,6 +92,4 @@ jobs: name: Pickup and Delivery Routing head_ref: ${{ github.head_ref }} head_sha: ${{ github.event.pull_request.head.sha }} - secrets: - JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }} - TIMEFOLD_SOLVER_CI_PROD_LICENSE: ${{ secrets.TIMEFOLD_SOLVER_CI_PROD_LICENSE }} \ No newline at end of file + secrets: inherit \ No newline at end of file From 4a951c1a925bae7d5f67167054cf1622dbb518ef Mon Sep 17 00:00:00 2001 From: rsynek Date: Fri, 26 Jun 2026 15:48:34 +0200 Subject: [PATCH 3/3] ci: use textual version replacement --- .github/workflows/downstream_build.yml | 27 ++++++++++++++----- .../pull_request_secure_downstream.yml | 12 ++++++--- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/.github/workflows/downstream_build.yml b/.github/workflows/downstream_build.yml index b6dee5f926..82d37303f5 100644 --- a/.github/workflows/downstream_build.yml +++ b/.github/workflows/downstream_build.yml @@ -93,10 +93,6 @@ jobs: java-version: '21' distribution: 'temurin' cache: 'maven' - # Set the JFrog credentials that will be used for downloading the solver service parent in the downstream build. - server-id: timefold - server-username: JRELEASER_JFROG_USERNAME - server-password: JRELEASER_JFROG_TOKEN - name: Quickly build timefold-solver working-directory: ./timefold-solver @@ -110,15 +106,32 @@ jobs: TIMEFOLD_LICENSE: ${{ secrets.TIMEFOLD_SOLVER_CI_PROD_LICENSE }} run: ./mvnw -B -Dquickly clean install + - name: Switch ${{ inputs.name }} to Solver 999-SNAPSHOT + working-directory: ./${{ inputs.repository }} + shell: bash + run: | + POM="pom.xml" + TARGET_VERSION="999-SNAPSHOT" + + # Replace the first element (parent version) in pom.xml. + sed -i '0,/^\s*/s|[^<]*|'"$TARGET_VERSION"'|' "$POM" + + # Verify the parent version is now TARGET_VERSION + ACTUAL_VERSION=$(grep -m1 '^\s*' "$POM" | sed 's|.*\(.*\).*|\1|') + + if [ "$ACTUAL_VERSION" = "$TARGET_VERSION" ]; then + exit 0 + else + echo "Expected parent version $TARGET_VERSION but found $ACTUAL_VERSION" >&2 + exit 1 + fi + - name: Build and test ${{ inputs.name }} working-directory: ./${{ inputs.repository }} shell: bash env: TIMEFOLD_LICENSE: ${{ secrets.TIMEFOLD_SOLVER_CI_PROD_LICENSE }} - JRELEASER_JFROG_USERNAME: ${{ secrets.JRELEASER_JFROG_USERNAME }} - JRELEASER_JFROG_TOKEN: ${{ secrets.JRELEASER_JFROG_TOKEN }} run: | - mvn versions:update-parent -DskipResolution=true -DallowSnapshots=true -DparentVersion=999-SNAPSHOT mvn -B clean verify - name: Test Summary diff --git a/.github/workflows/pull_request_secure_downstream.yml b/.github/workflows/pull_request_secure_downstream.yml index c216e9a31d..3b2fd517dd 100644 --- a/.github/workflows/pull_request_secure_downstream.yml +++ b/.github/workflows/pull_request_secure_downstream.yml @@ -72,7 +72,9 @@ jobs: name: Field Service Routing head_ref: ${{ github.head_ref }} head_sha: ${{ github.event.pull_request.head.sha }} - secrets: inherit + secrets: + JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }} + TIMEFOLD_SOLVER_CI_PROD_LICENSE: ${{ secrets.TIMEFOLD_SOLVER_CI_PROD_LICENSE }} timefold-employee-scheduling: needs: approval_required @@ -82,7 +84,9 @@ jobs: name: Employee Scheduling head_ref: ${{ github.head_ref }} head_sha: ${{ github.event.pull_request.head.sha }} - secrets: inherit + secrets: + JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }} + TIMEFOLD_SOLVER_CI_PROD_LICENSE: ${{ secrets.TIMEFOLD_SOLVER_CI_PROD_LICENSE }} timefold-pickup-delivery-routing: needs: approval_required @@ -92,4 +96,6 @@ jobs: name: Pickup and Delivery Routing head_ref: ${{ github.head_ref }} head_sha: ${{ github.event.pull_request.head.sha }} - secrets: inherit \ No newline at end of file + secrets: + JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }} + TIMEFOLD_SOLVER_CI_PROD_LICENSE: ${{ secrets.TIMEFOLD_SOLVER_CI_PROD_LICENSE }} \ No newline at end of file