diff --git a/.github/workflows/apt.yml b/.github/workflows/apt.yml index d7a8b8e..5cae3ce 100644 --- a/.github/workflows/apt.yml +++ b/.github/workflows/apt.yml @@ -1,4 +1,4 @@ -name: Build Pull Request +name: Build on: pull_request: @@ -14,6 +14,14 @@ on: workflow_dispatch: workflow_call: +run-name: >- + ${{ (github.ref_name == 'unstable' + || github.event_name == 'workflow_dispatch' + || github.event_name == 'workflow_call') + && 'Build Unstable' + || format('Build on {0} to {1}', github.event_name, github.ref_name) + }} + jobs: build-n-test: uses: ./.github/workflows/build-n-test-all-distros.yml @@ -22,11 +30,14 @@ jobs: BUILD_ARCHS: ${{ vars.BUILD_ARCHS }} BUILD_EXCLUDE: ${{ vars.BUILD_EXCLUDE }} SMOKE_TEST_IMAGES: ${{ vars.SMOKE_TEST_IMAGES }} + # determine whether we should use special "unstable" release_tag + # Assume that for unstable branch and for any external call or dispatch + # we are building unstable release + # In other cases it's a regular PR/push build release_tag: >- ${{ (github.ref_name == 'unstable' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && 'unstable' || '' - }} - checkout_ref: ${{ github.ref_name == 'unstable' && 'unstable' || '' }} + }} \ No newline at end of file diff --git a/.github/workflows/build-n-test-all-distros.yml b/.github/workflows/build-n-test-all-distros.yml index 07a816b..c6b4b07 100644 --- a/.github/workflows/build-n-test-all-distros.yml +++ b/.github/workflows/build-n-test-all-distros.yml @@ -14,10 +14,6 @@ on: type: string SMOKE_TEST_IMAGES: type: string - checkout_ref: - type: string - default: '' - jobs: build-source-package: @@ -30,7 +26,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - ref: ${{ inputs.checkout_ref || '' }} + ref: ${{ inputs.release_tag == 'unstable' && 'unstable' || '' }} - name: Ensure Release Branch if: inputs.release_tag != '' && inputs.release_tag != 'unstable' id: ensure-branch @@ -43,7 +39,7 @@ jobs: with: dist: ${{ matrix.dist }} release_tag: ${{ inputs.release_tag }} - checkout_ref: ${{ inputs.checkout_ref || '' }} + checkout_ref: ${{ inputs.release_tag == 'unstable' && 'unstable' || '' }} build-binary-package: runs-on: ${{ contains(matrix.arch, 'arm') && 'ubuntu24-arm64-2-8' || 'ubuntu-24.04' }} @@ -58,7 +54,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - ref: ${{ inputs.checkout_ref || '' }} + ref: ${{ inputs.release_tag == 'unstable' && 'unstable' || '' }} - name: Ensure Release Branch if: inputs.release_tag != '' && inputs.release_tag != 'unstable' id: ensure-branch @@ -72,7 +68,7 @@ jobs: dist: ${{ matrix.dist }} arch: ${{ matrix.arch }} run_id: ${{ github.run_id }} - checkout_ref: ${{ inputs.checkout_ref || '' }} + checkout_ref: ${{ inputs.release_tag == 'unstable' && 'unstable' || '' }} smoke-test-archs: runs-on: ubuntu-latest @@ -103,10 +99,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - ref: ${{ inputs.checkout_ref || '' }} + ref: ${{ inputs.release_tag == 'unstable' && 'unstable' || '' }} - uses: ./.github/actions/run-smoke-tests with: image: ${{ matrix.image }} arch: ${{ matrix.arch }} run_id: ${{ github.run_id }} - checkout_ref: ${{ inputs.checkout_ref || '' }} + checkout_ref: ${{ inputs.release_tag == 'unstable' && 'unstable' || '' }}