Skip to content

Commit

Permalink
AWS Test env CI
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 6d4c457
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions .github/workflows/build-release-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ name: Build Release Packages
on:
release:
types: [published]

pull_request:
paths:
- '.github/workflows/build-release-packages.yml'
- '.github/workflows/call-build-linux-arm-packages.yml'
- '.github/workflows/call-build-linux-x86_64-packages.yml'
- 'utils/releasetools/**'
workflow_dispatch:
inputs:
version:
Expand All @@ -21,8 +26,8 @@ jobs:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.VERSION }}
is_test: ${{ steps.check-env.outputs.IS_TEST }}
steps:

- run: |
echo "Version: ${{ inputs.version || github.ref_name }}"
shell: bash
Expand All @@ -33,8 +38,13 @@ jobs:
- name: Get the version
id: get_version
run: |
VERSION="${INPUT_VERSION}"
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
VERSION="unstable"
else
VERSION="${INPUT_VERSION}"
fi
if [ -z "${VERSION}" ]; then
echo "Error: No version specified"
exit 1
fi
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
Expand All @@ -44,6 +54,16 @@ jobs:
# only ever be a tag
INPUT_VERSION: ${{ inputs.version || github.ref_name }}

- name: Set bucket name
id: check-env
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "IS_TEST=true" >> $GITHUB_OUTPUT
else
echo "IS_TEST=false" >> $GITHUB_OUTPUT
fi
shell: bash

generate-build-matrix:
name: Generating build matrix
runs-on: ubuntu-latest
Expand All @@ -57,7 +77,7 @@ jobs:
- uses: ./.github/actions/generate-package-build-matrix
id: set-matrix
with:
ref: ${{ inputs.version || github.ref_name }}
ref: ${{ needs.release-build-get-meta.outputs.version }}

release-build-linux-x86-packages:
needs:
Expand All @@ -70,7 +90,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.is_test == 'true' && secrets.AWS_TEST_BUCKET || secrets.AWS_S3_BUCKET }}
role_to_assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}

release-build-linux-arm-packages:
Expand All @@ -84,5 +104,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.is_test == 'true' && secrets.AWS_TEST_BUCKET || secrets.AWS_S3_BUCKET }}
role_to_assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}

0 comments on commit 6d4c457

Please sign in to comment.