Skip to content

Commit

Permalink
Create a PR CI in test bucket
Browse files Browse the repository at this point in the history
Signed-off-by: vudiep411 <[email protected]>
  • Loading branch information
vudiep411 committed Dec 2, 2024
1 parent cd1fe2d commit 5c9474a
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/build-release-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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 }}

0 comments on commit 5c9474a

Please sign in to comment.