diff --git a/.github/workflows/downstream_build.yml b/.github/workflows/downstream_build.yml index 4733cc4d7a..82d37303f5 100644 --- a/.github/workflows/downstream_build.yml +++ b/.github/workflows/downstream_build.yml @@ -106,13 +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 }} run: | - mvn versions:update-parent -DskipResolution=true -DallowSnapshots=true -DparentVersion=999-SNAPSHOT mvn -B clean verify - name: Test Summary