From 5c9474a8923d3ae1364abcc910017345f30a5608 Mon Sep 17 00:00:00 2001 From: vudiep411 Date: Mon, 2 Dec 2024 11:27:59 -0800 Subject: [PATCH] Create a PR CI in test bucket Signed-off-by: vudiep411 --- .github/workflows/build-release-packages.yml | 24 ++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-release-packages.yml b/.github/workflows/build-release-packages.yml index 3f8ed95972..d6b4bd5c05 100644 --- a/.github/workflows/build-release-packages.yml +++ b/.github/workflows/build-release-packages.yml @@ -3,7 +3,13 @@ name: Build Release Packages on: release: types: [published] - + pull_request: + types: [opened, synchronize, reopened] + paths: + - '.github/workflows/build-release-package.yml' + - '.github/workflows/call-build-linux-arm-packages.yml' + - '.github/workflows/call-build-linux-x86-packages.yml' + - 'utils/releasetools/**' workflow_dispatch: inputs: version: @@ -21,8 +27,8 @@ jobs: runs-on: ubuntu-latest outputs: version: ${{ steps.get_version.outputs.VERSION }} + bucket_name: ${{ steps.set_bucket.outputs.BUCKET_NAME }} steps: - - run: | echo "Version: ${{ inputs.version || github.ref_name }}" shell: bash @@ -44,6 +50,16 @@ jobs: # only ever be a tag INPUT_VERSION: ${{ inputs.version || github.ref_name }} + - name: Set bucket name + id: set_bucket + run: | + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + echo "BUCKET_NAME=${{ secrets.AWS_TEST_BUCKET }}" >> $GITHUB_OUTPUT + else + echo "BUCKET_NAME=${{ secrets.AWS_S3_BUCKET }}" >> $GITHUB_OUTPUT + fi + shell: bash + generate-build-matrix: name: Generating build matrix runs-on: ubuntu-latest @@ -70,7 +86,7 @@ jobs: build_matrix: ${{ needs.generate-build-matrix.outputs.x86_64-build-matrix }} region: us-west-2 secrets: - bucket_name: ${{ secrets.AWS_S3_BUCKET }} + bucket_name: ${{ needs.release-build-get-meta.outputs.bucket_name }} role_to_assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} release-build-linux-arm-packages: @@ -84,5 +100,5 @@ jobs: build_matrix: ${{ needs.generate-build-matrix.outputs.arm64-build-matrix }} region: us-west-2 secrets: - bucket_name: ${{ secrets.AWS_S3_BUCKET }} + bucket_name: ${{ needs.release-build-get-meta.outputs.bucket_name }} role_to_assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}