From 8f36894ea45986d226bc79fb5e9f995f46eb9f0e Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Tue, 16 Apr 2024 18:34:41 +0200 Subject: [PATCH 1/4] Delete .github/actions/maven-build-migration.yml --- .github/actions/maven-build-migration.yml | 52 ----------------------- 1 file changed, 52 deletions(-) delete mode 100644 .github/actions/maven-build-migration.yml diff --git a/.github/actions/maven-build-migration.yml b/.github/actions/maven-build-migration.yml deleted file mode 100644 index eb1391d8ba..0000000000 --- a/.github/actions/maven-build-migration.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Maven Build -description: Run a Maven Build - -inputs: - build-command: - description: The Maven command to build the project. The default is `package`. - required: false - # type: string - `type` field is not supported (yet). See comment below. - default: install - release-name: - description: The Maven artifact name and version. - required: true - build-flags: - description: The Maven build flags - required: false - default: '-Dmaven.repo.local=$GITHUB_WORKSPACE/.m2' # why the local artifactory is required - #deploy-flags: #compose from build-flags and maven-settings - # description: The Maven deploy flags - # required: false - # default: '-s $GITHUB_WORKSPACE/settings.xml -Dmaven.repo.local=$GITHUB_WORKSPACE/.m2' # not required since actions/setup-java allows the definition of the settings file path and build-flags already define the ref to the local artifactory - build-profiles: - description: The maven build profiles - required: false - default: 'daml,scala,typescript,golang,csharp8,csharp9,kotlin,python,full,gpg,excel' # TBD whether this is useful for the parallel build tasks - maven-settings: - description: The Maven settings file - required: false - default: $GITHUB_WORKSPACE/settings.xml - -runs: - using: "composite" - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 11 for x64 - uses: actions/setup-java@v4 - with: - java-version: '11' - distribution: 'temurin' - architecture: x64 - cache: maven - server-id: ossrh - server-username: CI_DEPLOY_USERNAME - server-password: CI_DEPLOY_PASSWORD - settings-path: ${{inputs.maven-settings}} - gpg-private-key: GPG_PRIVATE_KEY - gpg-passphrase: GPG_PASSPHRASE - - name: Set artifact version with Maven - shell: bash - run: mvn ${{inputs.build-flags}} versions:set -DnewVersion=${{inputs.release-name}} versions:update-child-modules -DallowSnapshots=true - - name: Build and deploy artifact with Maven - shell: bash - run: mvn ${{inputs.build-flags}} clean ${{inputs.build-command}} -P ${{inputs.build-profiles}} From b7514f8044cb8be21335359856fa05f92a2705bf Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Tue, 16 Apr 2024 18:39:55 +0200 Subject: [PATCH 2/4] Update action.yml --- .github/actions/build-migration/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-migration/action.yml b/.github/actions/build-migration/action.yml index 49e0030cd0..e9eff5c940 100644 --- a/.github/actions/build-migration/action.yml +++ b/.github/actions/build-migration/action.yml @@ -25,7 +25,7 @@ inputs: maven-settings: description: The Maven settings file required: false - default: $GITHUB_WORKSPACE/settings.xml + default: $GITHUB_WORKSPACE runs: using: "composite" From b6249de44538b6135934b70d17e62c62a5df6288 Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Tue, 16 Apr 2024 18:40:45 +0200 Subject: [PATCH 3/4] Update migration-test.yml --- .github/workflows/migration-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/migration-test.yml b/.github/workflows/migration-test.yml index e2cab83a5c..e0f29f7aae 100644 --- a/.github/workflows/migration-test.yml +++ b/.github/workflows/migration-test.yml @@ -72,7 +72,7 @@ jobs: release-name: ${{needs.setup.outputs.RELEASE_NAME}} build-flags: ${{needs.setup.outputs.MVN_BUILD_FLAGS}} build-profiles: ${{needs.setup.outputs.RELEASE_MVN_DEPLOY_FILE_FLAGS}} - maven-settings: $GITHUB_WORKSPACE/settings.xml + #maven-settings: $GITHUB_WORKSPACE env: GPG_KEYNAME: ${{secrets.GPG_KEYNAME}} GPG_PRIVATE_KEY: ${{secrets.GPG_PRIVATE_KEY}} @@ -88,7 +88,7 @@ jobs: release-name: ${{needs.setup.outputs.SNAPSHOT_NAME}} build-flags: ${{needs.setup.outputs.MVN_BUILD_FLAGS}} build-profiles: ${{needs.setup.outputs.SNAPSHOT_MVN_DEPLOY_FILE_FLAGS}} - maven-settings: $GITHUB_WORKSPACE/settings.xml + #maven-settings: $GITHUB_WORKSPACE env: GPG_KEYNAME: ${{secrets.GPG_KEYNAME}} GPG_PRIVATE_KEY: ${{secrets.GPG_PRIVATE_KEY}} From a6cf53bac2679737530e02ecbd5b8afc980c2506 Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Thu, 18 Apr 2024 18:33:57 +0200 Subject: [PATCH 4/4] Update migration-test.yml condition to filter between merged or dismissed PRs --- .github/workflows/migration-test.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/migration-test.yml b/.github/workflows/migration-test.yml index e0f29f7aae..038029a6fc 100644 --- a/.github/workflows/migration-test.yml +++ b/.github/workflows/migration-test.yml @@ -7,9 +7,7 @@ on: pull_request: #triggers on PR merge event into develop branch types: - closed - branches: - - 'develop' - + jobs: setup: # defines the variables used across all job's steps and output variables to be used across jobs. runs-on: ubuntu-latest @@ -34,7 +32,7 @@ jobs: - name: ReleaseProperties id: release_props - if: startsWith(github.event.ref, 'refs/tags/**') + if: startsWith(github.ref, 'refs/tags') shell: bash run: | echo "RELEASE_NAME=${{env.RELEASE_NAME}}" >> "$GITHUB_OUTPUT" @@ -47,7 +45,7 @@ jobs: - name: SnapshotProperties id: snapshot_props - if: github.ref == 'refs/heads/develop' + if: github.ref == 'refs/heads/develop' && github.event.pull_request.merged == true shell: bash run: | echo "SNAPSHOT_NAME=${{env.RELEASE_NAME}}" >> "$GITHUB_OUTPUT" @@ -65,14 +63,14 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build Release CI - if: startsWith(github.event.ref, 'refs/tags/**') + if: startsWith(github.event.ref, 'refs/tags') uses: ./.github/actions/build-migration with: build-command: install release-name: ${{needs.setup.outputs.RELEASE_NAME}} build-flags: ${{needs.setup.outputs.MVN_BUILD_FLAGS}} build-profiles: ${{needs.setup.outputs.RELEASE_MVN_DEPLOY_FILE_FLAGS}} - #maven-settings: $GITHUB_WORKSPACE + maven-settings: $GITHUB_WORKSPACE/settings.xml env: GPG_KEYNAME: ${{secrets.GPG_KEYNAME}} GPG_PRIVATE_KEY: ${{secrets.GPG_PRIVATE_KEY}} @@ -81,14 +79,14 @@ jobs: CI_DEPLOY_PASSWORD: ${{secrets.CI_DEPLOY_PASSWORD}} - name: Build Snapshot CI - if: github.ref == 'refs/heads/develop' + if: github.ref == 'refs/heads/develop' && github.event.pull_request.merged == true uses: ./.github/actions/build-migration with: build-command: verify release-name: ${{needs.setup.outputs.SNAPSHOT_NAME}} build-flags: ${{needs.setup.outputs.MVN_BUILD_FLAGS}} build-profiles: ${{needs.setup.outputs.SNAPSHOT_MVN_DEPLOY_FILE_FLAGS}} - #maven-settings: $GITHUB_WORKSPACE + maven-settings: $GITHUB_WORKSPACE/settings.xml env: GPG_KEYNAME: ${{secrets.GPG_KEYNAME}} GPG_PRIVATE_KEY: ${{secrets.GPG_PRIVATE_KEY}}