From 77665a13203e35708f4676c76db2e864802c2aa8 Mon Sep 17 00:00:00 2001 From: quebim Date: Wed, 30 Oct 2024 16:14:04 -0300 Subject: [PATCH] Update GHA build workflow to always upload package to the S3 bucket Remove 'upload' check on workflow input --- .github/workflows/build.yml | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d70939262112..4c7a4acd44933 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,10 +11,6 @@ on: description: "Revision" type: string default: "0" - upload: - description: "Upload ?" - type: boolean - default: false is_stage: description: "Is stage ?" type: boolean @@ -302,39 +298,27 @@ jobs: if-no-files-found: error - name: Set up AWS CLI - if: ${{ inputs.upload }} uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.CI_INTERNAL_DEVELOPMENT_BUCKET_USER_ACCESS_KEY }} aws-secret-access-key: ${{ secrets.CI_INTERNAL_DEVELOPMENT_BUCKET_USER_SECRET_KEY }} aws-region: ${{ secrets.CI_AWS_REGION }} - - name: Check if package exists on S3 - if: ${{ inputs.upload }} - run: | - dest="s3://packages-dev.internal.wazuh.com/development/wazuh/5.x/main/packages/" - s3uri="${dest}${{ steps.package.outputs.name }}" - if aws s3 ls "$s3uri" > /dev/null 2>&1; then - echo "exists=true" >> $GITHUB_OUTPUT - else - echo "exists=false" >> $GITHUB_OUTPUT - fi - id: package_in_s3 - - name: Upload package to S3 - if: ${{ inputs.upload && steps.package_in_s3.outputs.exists == 'false' }} run: | src="artifacts/dist/${{ steps.package.outputs.name }}" dest="s3://packages-dev.internal.wazuh.com/development/wazuh/5.x/main/packages/" aws s3 cp "$src" "$dest" s3uri="${dest}${{ steps.package.outputs.name }}" - echo "::notice::"S3 URI: ${s3uri}" + echo "::notice::S3 URI: ${s3uri}" + echo "**Package S3 URI:** ${s3uri}" >> $GITHUB_STEP_SUMMARY - - name: Upload checksum to S3 + - name: Upload checksum to S3sha512 if: ${{ inputs.upload && inputs.checksum }} run: | src="artifacts/dist/${{ steps.package.outputs.name }}.sha512" dest="s3://packages-dev.internal.wazuh.com/development/wazuh/5.x/main/packages/" aws s3 cp "$src" "$dest" s3uri="${dest}${{ steps.package.outputs.name }}.sha512" - echo ""::notice::S3 sha512 URI: ${s3uri}" + echo "::notice::S3 sha512 URI: ${s3uri}" + echo "**Package checksum S3 URI:** ${s3uri}" >> $GITHUB_STEP_SUMMARY