From 49438791f13f4d8b0d3a9edaf57a08c3aca8c4ac Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Date: Thu, 25 Apr 2024 07:35:09 +0200 Subject: [PATCH] DAT-17532 Allow obfuscation when using parent pom and reusable workflows (#200) * ci(workflows): add support for specifying different Maven profiles in GitHub workflows * build(workflows): update liquibase/build-logic workflows to version v0.7.3 for consistency and bug fixes docs(README): update release version in README to v0.7.3 for accuracy and clarity * build(create-release.yml): update liquibase/build-logic version to v0.7.4 build(extension-attach-artifact-release.yml): update liquibase/build-logic version to v0.7.4 build(extension-release-prepare.yml): update liquibase/build-logic version to v0.7.4 build(extension-release-published.yml): update liquibase/build-logic version to v0.7.4 build(fossa_ai.yml): update liquibase/build-logic version to v0.7.4 build(os-extension-test.yml): update liquibase/build-logic version to v0.7.4 build(pom-release-published.yml): update liquibase/build-logic version to v0.7.4 build(pro-extension-test.yml): update liquibase/build-logic version to v0.7.4 docs(README.md): update build-logic version to v0.7.4 in release instructions --- .github/workflows/create-release.yml | 2 +- .../extension-attach-artifact-release.yml | 17 +++++++++++------ .github/workflows/extension-release-prepare.yml | 2 +- .../workflows/extension-release-published.yml | 2 +- .github/workflows/fossa_ai.yml | 2 +- .github/workflows/os-extension-test.yml | 2 +- .github/workflows/pom-release-published.yml | 2 +- .github/workflows/pro-extension-test.yml | 11 ++++++++--- README.md | 2 +- 9 files changed, 26 insertions(+), 16 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index d98e50f8..dc4bb8e3 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -11,7 +11,7 @@ on: jobs: sonar: - uses: liquibase/build-logic/.github/workflows/sonar-push.yml@v0.7.3 + uses: liquibase/build-logic/.github/workflows/sonar-push.yml@v0.7.4 secrets: inherit with: extraCommand: ${{ inputs.extraCommand }} diff --git a/.github/workflows/extension-attach-artifact-release.yml b/.github/workflows/extension-attach-artifact-release.yml index e76b43a5..491c3450 100644 --- a/.github/workflows/extension-attach-artifact-release.yml +++ b/.github/workflows/extension-attach-artifact-release.yml @@ -13,6 +13,11 @@ on: required: false default: '' type: string + mavenProfiles: + description: "Specify it if you want to run different Maven profiles from the default (coverage). mavenProfiles example: 'coverage,run-proguard'" + required: false + default: "" + type: string secrets: BOT_TOKEN: description: 'BOT_TOKEN from the caller workflow' @@ -84,9 +89,9 @@ jobs: - name: Get Reusable Script Files run: | - curl -o $PWD/.github/get_draft_release.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.7.3/.github/get_draft_release.sh - curl -o $PWD/.github/sign_artifact.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.7.3/.github/sign_artifact.sh - curl -o $PWD/.github/upload_asset.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.7.3/.github/upload_asset.sh + curl -o $PWD/.github/get_draft_release.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.7.4/.github/get_draft_release.sh + curl -o $PWD/.github/sign_artifact.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.7.4/.github/sign_artifact.sh + curl -o $PWD/.github/upload_asset.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.7.4/.github/upload_asset.sh chmod +x $PWD/.github/get_draft_release.sh chmod +x $PWD/.github/sign_artifact.sh chmod +x $PWD/.github/upload_asset.sh @@ -104,9 +109,9 @@ jobs: - name: Build release artifacts id: build-release-artifacts run: | - mvn -B release:clean release:prepare -Darguments="-Dusername=liquibot -Dpassword=$GITHUB_TOKEN -Dmaven.javadoc.skip=true -Dmaven.test.skipTests=true -Dmaven.test.skip=true -Dmaven.deploy.skip=true" -DreleaseVersion=${{ github.event.inputs.liquibaseVersion }} -DpushChanges=false + mvn -B release:clean release:prepare -Darguments="-Dusername=liquibot -Dpassword=$GITHUB_TOKEN -Dmaven.javadoc.skip=true -Dmaven.test.skipTests=true -Dmaven.test.skip=true -Dmaven.deploy.skip=true" -DreleaseVersion=${{ github.event.inputs.liquibaseVersion }} -DpushChanges=false -P '${{ inputs.mavenProfiles }}' git reset HEAD~ --hard - mvn clean install -DskipTests + mvn clean install -DskipTests -P '${{ inputs.mavenProfiles }}' - name: Get Artifact ID id: get-artifact-id @@ -175,7 +180,7 @@ jobs: - name: Get upload_zip.sh Script File if: inputs.zip == 'true' run: | - curl -o $PWD/.github/upload_zip.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.7.3/.github/upload_zip.sh + curl -o $PWD/.github/upload_zip.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.7.4/.github/upload_zip.sh chmod +x $PWD/.github/upload_zip.sh - name: Attach Zip File to Draft Release diff --git a/.github/workflows/extension-release-prepare.yml b/.github/workflows/extension-release-prepare.yml index 8a3141d6..b5a50f82 100644 --- a/.github/workflows/extension-release-prepare.yml +++ b/.github/workflows/extension-release-prepare.yml @@ -107,7 +107,7 @@ jobs: release-rollback: needs: prepare-release if: ${{ always() && contains(needs.*.result, 'failure') }} - uses: liquibase/build-logic/.github/workflows/extension-release-rollback.yml@v0.7.3 + uses: liquibase/build-logic/.github/workflows/extension-release-rollback.yml@v0.7.4 secrets: inherit with: extraCommand: ${{ inputs.extraCommand }} diff --git a/.github/workflows/extension-release-published.yml b/.github/workflows/extension-release-published.yml index c8fad339..5c3c5fe3 100644 --- a/.github/workflows/extension-release-published.yml +++ b/.github/workflows/extension-release-published.yml @@ -23,7 +23,7 @@ on: jobs: maven-release: - uses: liquibase/build-logic/.github/workflows/extension-release-prepare.yml@v0.7.3 + uses: liquibase/build-logic/.github/workflows/extension-release-prepare.yml@v0.7.4 secrets: inherit with: extraCommand: ${{ inputs.extraCommand }} diff --git a/.github/workflows/fossa_ai.yml b/.github/workflows/fossa_ai.yml index 82733c47..be8cfc40 100644 --- a/.github/workflows/fossa_ai.yml +++ b/.github/workflows/fossa_ai.yml @@ -35,7 +35,7 @@ jobs: - name: Get Fossa Configuration if: ${{ inputs.check_ai_generated_code }} run: | - curl -o $PWD/.github/.fossa.yml https://raw.githubusercontent.com/liquibase/build-logic/v0.7.3/.github/.fossa.yml + curl -o $PWD/.github/.fossa.yml https://raw.githubusercontent.com/liquibase/build-logic/v0.7.4/.github/.fossa.yml - name: Install FOSSA CLI run: | diff --git a/.github/workflows/os-extension-test.yml b/.github/workflows/os-extension-test.yml index 5bb30d47..cb4c0d34 100644 --- a/.github/workflows/os-extension-test.yml +++ b/.github/workflows/os-extension-test.yml @@ -253,7 +253,7 @@ jobs: sonar-pr: if: ${{ !inputs.nightly }} needs: [unit-test] - uses: liquibase/build-logic/.github/workflows/sonar-pull-request.yml@v0.7.3 + uses: liquibase/build-logic/.github/workflows/sonar-pull-request.yml@v0.7.4 secrets: inherit with: extraCommand: ${{ inputs.extraCommand }} diff --git a/.github/workflows/pom-release-published.yml b/.github/workflows/pom-release-published.yml index 391c8c10..30ecb604 100644 --- a/.github/workflows/pom-release-published.yml +++ b/.github/workflows/pom-release-published.yml @@ -68,5 +68,5 @@ jobs: maven-release: needs: release - uses: liquibase/build-logic/.github/workflows/extension-release-prepare.yml@v0.7.3 + uses: liquibase/build-logic/.github/workflows/extension-release-prepare.yml@v0.7.4 secrets: inherit \ No newline at end of file diff --git a/.github/workflows/pro-extension-test.yml b/.github/workflows/pro-extension-test.yml index 2159a7c6..1e0634ff 100644 --- a/.github/workflows/pro-extension-test.yml +++ b/.github/workflows/pro-extension-test.yml @@ -38,6 +38,11 @@ on: required: false default: "" type: string + mavenProfiles: + description: "Specify it if you want to run different Maven profiles from the default (coverage). mavenProfiles example: 'coverage,run-proguard'" + required: false + default: "coverage" + type: string secrets: SONAR_TOKEN: description: "SONAR_TOKEN from the caller workflow" @@ -262,11 +267,11 @@ jobs: - name: Run Tests if: ${{ !inputs.nightly }} - run: mvn -B test -P 'coverage' ${{ inputs.extraMavenArgs }} + run: mvn -B test -P '${{ inputs.mavenProfiles }}' ${{ inputs.extraMavenArgs }} - name: Run Tests if: ${{ inputs.nightly }} - run: mvn -B test -P 'coverage' ${{ inputs.extraMavenArgs }} "-Dliquibase.version=master-SNAPSHOT" + run: mvn -B test -P '${{ inputs.mavenProfiles }}' ${{ inputs.extraMavenArgs }} "-Dliquibase.version=master-SNAPSHOT" - name: Notify Slack on Build Failure if: ${{ failure() && inputs.nightly }} @@ -293,7 +298,7 @@ jobs: sonar-pr: if: ${{ !inputs.nightly }} needs: [unit-test] - uses: liquibase/build-logic/.github/workflows/sonar-pull-request.yml@v0.7.3 + uses: liquibase/build-logic/.github/workflows/sonar-pull-request.yml@v0.7.4 secrets: inherit with: extraCommand: ${{ inputs.extraCommand }} diff --git a/README.md b/README.md index 59449869..bdf4893e 100644 --- a/README.md +++ b/README.md @@ -451,4 +451,4 @@ Here the modules we want to generate and aggregate test reports must be specifie ### Releasing a new version of build-logic -When you want to release new version of `build-logic`, it is important to update all the occurrences of previous version eg: `v0.6.9` with the new version eg : `v0.7.3` in all the files. As, the code for the new version internally refers to the old version. +When you want to release new version of `build-logic`, it is important to update all the occurrences of previous version eg: `v0.6.9` with the new version eg : `v0.7.4` in all the files. As, the code for the new version internally refers to the old version.