From 644ef79054fd4673820b875b6243488af20fcadb Mon Sep 17 00:00:00 2001 From: Adrien Kantcheff <5028967+akantcheff@users.noreply.github.com> Date: Tue, 12 Mar 2024 18:05:21 +0100 Subject: [PATCH] ci(build): fix incomplete maven deploy (#44) Also remove the upload bos step as it is already pushed on JFrog --- .github/workflows/_reusable_build.yml | 46 ++++++--------------------- 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/.github/workflows/_reusable_build.yml b/.github/workflows/_reusable_build.yml index f2384d5..5d3cfa3 100644 --- a/.github/workflows/_reusable_build.yml +++ b/.github/workflows/_reusable_build.yml @@ -10,29 +10,16 @@ on: publish: type: boolean default: false - description: Publish artifacts to Maven repository - repository-id: + description: To publish the project artifacts to the Maven alternative repository. + alt-deployment-repository: type: string - default: snapshots - description: Id of the Maven repository - repository-url: - type: string - default: ${{ vars.SNAPSHOTS_REPOSITORY_URL }} - description: URL of the Maven repository - upload-bos-file: - type: boolean - default: false - description: To upload the BOS file as a Github Artifact + default: snapshots::${{ vars.SNAPSHOTS_REPOSITORY_URL }} + description: Maven alternative repository to which the project artifacts should be deployed. secrets: BONITA_CI_PAT: required: true -permissions: - contents: read - checks: write - pull-requests: write - jobs: build: runs-on: ubuntu-22.04 @@ -57,24 +44,11 @@ jobs: keeper-secret-config: ${{ secrets.KSM_CONFIG }} - name: Maven Build - timeout-minutes: 90 - run: ./mvnw -ntp clean verify + if: ${{ !inputs.publish }} + timeout-minutes: 60 + run: ./mvnw -ntp verify - - name: Get deploy file + - name: Maven Build & Deploy if: ${{ inputs.publish }} - id: deploy-file - run: | - FILE_NAME=$(./mvnw help:evaluate -Dexpression=project.build.finalName -DforceStdout -q) - echo "DEPLOY_FILE=target/${FILE_NAME}.zip" >> "$GITHUB_OUTPUT" - - - name: Maven Deploy - if: ${{ inputs.publish }} - run: ./mvnw deploy:deploy-file -Dfile=${{ steps.deploy-file.outputs.DEPLOY_FILE }} -DrepositoryId=${{ inputs.repository-id }} -Durl=${{ inputs.repository-url }} - - - name: Upload .bos file - if: ${{ inputs.upload-bos-file }} - uses: actions/upload-artifact@v4 - with: - name: bonita-application-directory - path: "**/target/bonita-application-directory-*.bos" - retention-days: 10 + timeout-minutes: 60 + run: ./mvnw -ntp deploy -DaltDeploymentRepository=${{ inputs.alt-deployment-repository }}