From 555b5e0a17d4f8202e9705acf041ba3d05b53494 Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Mon, 26 Aug 2024 19:21:39 -0300 Subject: [PATCH 1/8] Fix Skip tests parameter --- .ci/jenkins/Jenkinsfile.deploy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index f29d52ca9f..dbd097d75f 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -112,7 +112,10 @@ pipeline { def mavenCommand = getMavenCommand().withProperty('maven.test.failure.ignore', true) .withOptions(env.BUILD_MVN_OPTS_CURRENT ? [ env.BUILD_MVN_OPTS_CURRENT ] : []) .withOptions(env.KOGITO_APPS_BUILD_MVN_OPTS ? [ env.KOGITO_APPS_BUILD_MVN_OPTS ] : []) - .skipTests(skipTests) + + if (params.SKIP_TESTS) { + mavenCommand.skipTests() + } if (isRelease()) { releaseUtils.gpgImportKeyFromStringWithoutPassword(getReleaseGpgSignKeyCredsId()) From 3c0460f6df9c838e3e5448eff3d171adc7a82ab4 Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Mon, 26 Aug 2024 22:42:07 -0300 Subject: [PATCH 2/8] Add missing function --- .ci/jenkins/Jenkinsfile.deploy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index dbd097d75f..b432e993ab 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -275,6 +275,10 @@ String getGitAuthorCredsId() { return env.GIT_AUTHOR_CREDS_ID } +String getGitAuthorPushCredsId() { + return env.GIT_AUTHOR_PUSH_CREDS_ID +} + String getBuildBranch() { return params.BUILD_BRANCH_NAME } From d3bc7aa0b84c7fe50ca8cc503297781518af0620 Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Tue, 27 Aug 2024 08:48:03 -0300 Subject: [PATCH 3/8] Fix publish-jitexecutor-native-rc github workflow --- .github/workflows/publish-jitexecutor-native-rc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-jitexecutor-native-rc.yml b/.github/workflows/publish-jitexecutor-native-rc.yml index a5cb5a12d8..e028f3fd46 100644 --- a/.github/workflows/publish-jitexecutor-native-rc.yml +++ b/.github/workflows/publish-jitexecutor-native-rc.yml @@ -51,7 +51,7 @@ jobs: maven-version: 3.9.6 - name: Import GPG key - uses: crazy-max/ghaction-import-gpg@v6 + uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549 with: gpg_private_key: ${{ secrets.GPG_KEY }} From 48b6d38aa23de79b7ff1d6f27e186a8e8b1b8467 Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Tue, 27 Aug 2024 09:14:53 -0300 Subject: [PATCH 4/8] Fix jit-executor-rc workflow --- .github/workflows/publish-jitexecutor-native-rc.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-jitexecutor-native-rc.yml b/.github/workflows/publish-jitexecutor-native-rc.yml index e028f3fd46..88f509ccec 100644 --- a/.github/workflows/publish-jitexecutor-native-rc.yml +++ b/.github/workflows/publish-jitexecutor-native-rc.yml @@ -28,10 +28,9 @@ jobs: echo "REF=${{github.event.pull_request.head.ref}}" >> "$GITHUB_OUTPUT" echo "PROJECT_VERSION=999-SNAPSHOT" >> "$GITHUB_OUTPUT" else - VERSION="${{ github.event.inputs.release_candidate_version }}" echo "REPOSITORY=apache/incubator-kie-kogito-apps" >> "$GITHUB_OUTPUT" - echo "REF=${VERSION//-SNAPSHOT/}" >> "$GITHUB_OUTPUT" - echo "PROJECT_VERSION=$VERSION" >> "$GITHUB_OUTPUT" + echo "REF=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" + echo "PROJECT_VERSION=${{ github.event.inputs.release_candidate_version }}" >> "$GITHUB_OUTPUT" fi shell: bash @@ -63,8 +62,6 @@ jobs: server-id: apache.releases.https server-username: ${{ secrets.NEXUS_STAGE_DEPLOYER_USER }} server-password: ${{ secrets.NEXUS_STAGE_DEPLOYER_PW }} - gpg-private-key: ${{ secrets.GPG_KEY }} - gpg-passphrase: "" - name: "Setup Linux" if: runner.os == 'Linux' @@ -136,7 +133,7 @@ jobs: if: runner.os == 'macOS' && github.event_name != 'pull_request' shell: bash run: | - mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl jitexecutor-native/jitexecutor-native-darwin -am -Pjitexecutor-native -Prelease + mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl jitexecutor-native/jitexecutor-native-darwin -am -Pjitexecutor-native -Papache-release - name: "Build Linux" if: runner.os == 'Linux' && github.event_name == 'pull_request' @@ -148,7 +145,7 @@ jobs: if: runner.os == 'Linux' && github.event_name != 'pull_request' shell: bash run: | - mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl jitexecutor-native/jitexecutor-native-linux -am -Pjitexecutor-native -Prelease + mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl jitexecutor-native/jitexecutor-native-linux -am -Pjitexecutor-native -Papache-release - name: "Build Windows" if: runner.os == 'Windows' && github.event_name == 'pull_request' @@ -160,7 +157,7 @@ jobs: if: runner.os == 'Windows' && github.event_name != 'pull_request' shell: pwsh run: | - mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl jitexecutor-native/jitexecutor-native-win32 -am -Pjitexecutor-native -Prelease + mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl jitexecutor-native/jitexecutor-native-win32 -am -Pjitexecutor-native -Papache-release - name: "Upload JIT Executor binary" uses: actions/upload-artifact@v4 From 503805c2bcd4c809ccea14672e365de1e8e5c7cb Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Tue, 27 Aug 2024 11:17:29 -0300 Subject: [PATCH 5/8] Fix jit-executor-rc workflow --- .../publish-jitexecutor-native-rc.yml | 218 +++++++++++++++++- 1 file changed, 207 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish-jitexecutor-native-rc.yml b/.github/workflows/publish-jitexecutor-native-rc.yml index 88f509ccec..6890232346 100644 --- a/.github/workflows/publish-jitexecutor-native-rc.yml +++ b/.github/workflows/publish-jitexecutor-native-rc.yml @@ -10,6 +10,12 @@ on: release_candidate_version: description: "Release candidate version" required: true + drools_repository: + description: "Drools repository" + required: true + kogito_runtimes_repository: + description: "Kogito runtimes repository" + required: true jobs: build_jitexecutor_native: @@ -54,15 +60,195 @@ jobs: with: gpg_private_key: ${{ secrets.GPG_KEY }} + - name: Setup maven settings (Linux and MacOS) + if: (runner.os == 'Linux' || runner.os == 'macOS') + env: + WORKDIR_PATH: ${{ github.workspace }} + DROOLS_REPO: ${{ github.event.inputs.drools_repository }} + KOGITO_RUNTIMES_REPO: ${{ github.event.inputs.kogito_runtimes_repository }} + run: | + mkdir -p ${WORKDIR_PATH}/.m2 + echo " + + + apache.releases.https + ${{ secrets.NEXUS_STAGE_DEPLOYER_USER }} + ${{ secrets.NEXUS_STAGE_DEPLOYER_PW }} + + + apache.snapshots.https + ${{ secrets.NEXUS_USER }} + ${{ secrets.NEXUS_PW }} + + + + + additional_repos + + + apache-kie-drools-staging-repository + Apache KIE Drools Staging Repository + ${DROOLS_REPO} + default + + true + never + + + false + never + + + + apache-kie-kogito-runtimes-staging-repository + Apache KIE Kogito Runtimes Staging Repository + ${KOGITO_RUNTIMES_REPO} + default + + true + never + + + false + never + + + + + + apache-kie-kogito-runtimes-staging-repository + Apache KIE Kogito Runtimes Staging Repository + ${KOGITO_RUNTIMES_REPO} + + true + never + + + false + never + + + + apache-kie-drools-staging-repository + Apache KIE Drools Staging Repository + ${DROOLS_REPO} + + true + never + + + false + never + + + + + + + additional_repos + + " > ${WORKDIR_PATH}/.m2/settings.xml + + - name: Setup maven settings (Windows) + if: runner.os == 'Windows' + env: + WORKDIR_PATH: ${{ github.workspace }} + DROOLS_REPO: ${{ github.event.inputs.drools_repository }} + KOGITO_RUNTIMES_REPO: ${{ github.event.inputs.kogito_runtimes_repository }} + shell: pwsh + run: | + New-Item -Name ".m2" -Path "$env:WORKDIR_PATH" -ItemType Directory + $contentToAdd = @" + + + + apache.releases.https + ${{ secrets.NEXUS_STAGE_DEPLOYER_USER }} + ${{ secrets.NEXUS_STAGE_DEPLOYER_PW }} + + + apache.snapshots.https + ${{ secrets.NEXUS_USER }} + ${{ secrets.NEXUS_PW }} + + + + + additional_repos + + + apache-kie-kogito-runtimes-staging-repository + Apache KIE Kogito Runtimes Staging Repository + $env:KOGITO_RUNTIMES_REPO + default + + true + never + + + false + never + + + + apache-kie-drools-staging-repository + Apache KIE Drools Staging Repository + $env:DROOLS_REPO + default + + true + never + + + false + never + + + + + + apache-kie-kogito-runtimes-staging-repository + Apache KIE Kogito Runtimes Staging Repository + $env:KOGITO_RUNTIMES_REPO + + true + never + + + false + never + + + + apache-kie-drools-staging-repository + Apache KIE Drools Staging Repository + $env:DROOLS_REPO + + true + never + + + false + never + + + + + + + additional_repos + + + "@ + Add-Content "$env:WORKDIR_PATH\.m2\settings.xml" $contentToAdd + - name: "Set up JDK 17" uses: actions/setup-java@v4 with: java-version: "17" distribution: "temurin" - server-id: apache.releases.https - server-username: ${{ secrets.NEXUS_STAGE_DEPLOYER_USER }} - server-password: ${{ secrets.NEXUS_STAGE_DEPLOYER_PW }} - + overwrite-settings: false + - name: "Setup Linux" if: runner.os == 'Linux' run: | @@ -112,16 +298,20 @@ jobs: - name: "Update versions (Linux and macOS)" if: (runner.os == 'Linux' || runner.os == 'macOS') && github.event_name != 'pull_request' shell: bash + env: + SETTINGS_FILE_PATH: ${{ github.workspace }}/.m2/settings.xml run: | - mvn -B -fae -ntp -N -e versions:update-parent -DparentVersion="[${{ steps.version.outputs.PROJECT_VERSION }}]" -DallowSnapshots=true -DgenerateBackupPoms=false - mvn -B -fae -ntp -N -e versions:update-child-modules -DallowSnapshots=true -DgenerateBackupPoms=false + mvn -B -fae -ntp -N -e versions:update-parent -DparentVersion="[${{ steps.version.outputs.PROJECT_VERSION }}]" -DallowSnapshots=true -DgenerateBackupPoms=false -s ${SETTINGS_FILE_PATH} + mvn -B -fae -ntp -N -e versions:update-child-modules -DallowSnapshots=true -DgenerateBackupPoms=false -s ${SETTINGS_FILE_PATH} - name: "Update versions Windows" if: runner.os == 'Windows' && github.event_name != 'pull_request' shell: pwsh + env: + SETTINGS_FILE_PATH: ${{ github.workspace }}\.m2\settings.xml run: | - mvn -B -fae -ntp -N -e versions:update-parent -DparentVersion="[${{ steps.version.outputs.PROJECT_VERSION }}]" -DallowSnapshots=true -DgenerateBackupPoms=false - mvn -B -fae -ntp -N -e versions:update-child-modules -DallowSnapshots=true -DgenerateBackupPoms=false + mvn -B -fae -ntp -N -e versions:update-parent -DparentVersion="[${{ steps.version.outputs.PROJECT_VERSION }}]" -DallowSnapshots=true -DgenerateBackupPoms=false -s $env:SETTINGS_FILE_PATH + mvn -B -fae -ntp -N -e versions:update-child-modules -DallowSnapshots=true -DgenerateBackupPoms=false -s $env:SETTINGS_FILE_PATH - name: "Build macOS" if: runner.os == 'macOS' && github.event_name == 'pull_request' @@ -132,8 +322,10 @@ jobs: - name: "Build and publish macOS" if: runner.os == 'macOS' && github.event_name != 'pull_request' shell: bash + env: + SETTINGS_FILE_PATH: ${{ github.workspace }}/.m2/settings.xml run: | - mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl jitexecutor-native/jitexecutor-native-darwin -am -Pjitexecutor-native -Papache-release + mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl jitexecutor-native/jitexecutor-native-darwin -am -Pjitexecutor-native -Papache-release -s ${SETTINGS_FILE_PATH} - name: "Build Linux" if: runner.os == 'Linux' && github.event_name == 'pull_request' @@ -144,8 +336,10 @@ jobs: - name: "Build and Publish Linux" if: runner.os == 'Linux' && github.event_name != 'pull_request' shell: bash + env: + SETTINGS_FILE_PATH: ${{ github.workspace }}/.m2/settings.xml run: | - mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl jitexecutor-native/jitexecutor-native-linux -am -Pjitexecutor-native -Papache-release + mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl jitexecutor-native/jitexecutor-native-linux -am -Pjitexecutor-native -Papache-release -s ${SETTINGS_FILE_PATH} - name: "Build Windows" if: runner.os == 'Windows' && github.event_name == 'pull_request' @@ -156,8 +350,10 @@ jobs: - name: "Build and Publish Windows" if: runner.os == 'Windows' && github.event_name != 'pull_request' shell: pwsh + env: + SETTINGS_FILE_PATH: ${{ github.workspace }}\.m2\settings.xml run: | - mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl jitexecutor-native/jitexecutor-native-win32 -am -Pjitexecutor-native -Papache-release + mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl jitexecutor-native/jitexecutor-native-win32 -am -Pjitexecutor-native -Papache-release -s $env:SETTINGS_FILE_PATH - name: "Upload JIT Executor binary" uses: actions/upload-artifact@v4 From 2f9424b6a495e9ca6b6f55f3c707007a118bc2cd Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Tue, 27 Aug 2024 13:13:36 -0300 Subject: [PATCH 6/8] Remove jit-executor-native workflow job trigger --- .ci/jenkins/Jenkinsfile.deploy | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index b432e993ab..58e0c532bb 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -183,22 +183,6 @@ pipeline { } } } - - stage('Trigger JIT Executor Native - Release Candidate - GH workflow') { - steps { - script { - dir(getRepoName()) { - withCredentials([usernamePassword(credentialsId: "${getGitAuthorPushCredsId()}", usernameVariable: 'GITHUB_USER', passwordVariable: 'GITHUB_TOKEN')]) { - sh """ - git config user.email ${GITHUB_USER}@jenkins.kie.apache.org - git config user.name ${GITHUB_USER} - gh workflow run "publish-jitexecutor-native-rc.yml" --ref "${getBuildBranch()}" -f release_candidate_version="${getProjectVersion()}" --repo="https://github.com/${getGitAuthor()}/${getRepoName()}" - """ - } - } - } - } - } } post { always { From 8f064d06f9bd864cd6ea682d3f552169759142c1 Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Tue, 27 Aug 2024 13:43:55 -0300 Subject: [PATCH 7/8] Do not import GPG KEY for pull requests --- .github/workflows/publish-jitexecutor-native-rc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-jitexecutor-native-rc.yml b/.github/workflows/publish-jitexecutor-native-rc.yml index 6890232346..b0d2acc7c5 100644 --- a/.github/workflows/publish-jitexecutor-native-rc.yml +++ b/.github/workflows/publish-jitexecutor-native-rc.yml @@ -56,6 +56,7 @@ jobs: maven-version: 3.9.6 - name: Import GPG key + if: ${{ github.event_name }} != "pull_request" uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549 with: gpg_private_key: ${{ secrets.GPG_KEY }} From ff5438a164ecf7bdf7f464a7e012934b5c27fd32 Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Tue, 27 Aug 2024 13:53:13 -0300 Subject: [PATCH 8/8] Do not import GPG KEY for pull requests --- .github/workflows/publish-jitexecutor-native-rc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-jitexecutor-native-rc.yml b/.github/workflows/publish-jitexecutor-native-rc.yml index b0d2acc7c5..e6893a814a 100644 --- a/.github/workflows/publish-jitexecutor-native-rc.yml +++ b/.github/workflows/publish-jitexecutor-native-rc.yml @@ -56,7 +56,7 @@ jobs: maven-version: 3.9.6 - name: Import GPG key - if: ${{ github.event_name }} != "pull_request" + if: github.event_name != 'pull_request' uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549 with: gpg_private_key: ${{ secrets.GPG_KEY }}