diff --git a/.github/workflows/build-release-packages.yml b/.github/workflows/build-release-packages.yml index 3f8ed95972..d0e3a775f7 100644 --- a/.github/workflows/build-release-packages.yml +++ b/.github/workflows/build-release-packages.yml @@ -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: @@ -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 @@ -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 @@ -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 @@ -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: @@ -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: @@ -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 }}