Skip to content

Commit 65254d1

Browse files
committed
Use release_tag to determine whether we require explicit switch to unstable
1 parent 98ddd9a commit 65254d1

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

.github/workflows/apt.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Pull Request
1+
name: Build
22

33
on:
44
pull_request:
@@ -14,6 +14,14 @@ on:
1414
workflow_dispatch:
1515
workflow_call:
1616

17+
run-name: >-
18+
${{ (github.ref_name == 'unstable'
19+
|| github.event_name == 'workflow_dispatch'
20+
|| github.event_name == 'workflow_call')
21+
&& 'Build Unstable'
22+
|| format('Build on {0} to {1}', github.event_name, github.ref_name)
23+
}}
24+
1725
jobs:
1826
build-n-test:
1927
uses: ./.github/workflows/build-n-test-all-distros.yml
@@ -22,11 +30,14 @@ jobs:
2230
BUILD_ARCHS: ${{ vars.BUILD_ARCHS }}
2331
BUILD_EXCLUDE: ${{ vars.BUILD_EXCLUDE }}
2432
SMOKE_TEST_IMAGES: ${{ vars.SMOKE_TEST_IMAGES }}
33+
# determine whether we should use special "unstable" release_tag
34+
# Assume that for unstable branch and for any external call or dispatch
35+
# we are building unstable release
36+
# In other cases it's a regular PR/push build
2537
release_tag: >-
2638
${{ (github.ref_name == 'unstable'
2739
|| github.event_name == 'workflow_dispatch'
2840
|| github.event_name == 'workflow_call')
2941
&& 'unstable'
3042
|| ''
31-
}}
32-
checkout_ref: ${{ github.ref_name == 'unstable' && 'unstable' || '' }}
43+
}}

.github/workflows/build-n-test-all-distros.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ on:
1414
type: string
1515
SMOKE_TEST_IMAGES:
1616
type: string
17-
checkout_ref:
18-
type: string
19-
default: ''
20-
2117

2218
jobs:
2319
build-source-package:
@@ -30,7 +26,7 @@ jobs:
3026
- name: Checkout code
3127
uses: actions/checkout@v4
3228
with:
33-
ref: ${{ inputs.checkout_ref || '' }}
29+
ref: ${{ inputs.release_tag == 'unstable' && 'unstable' || '' }}
3430
- name: Ensure Release Branch
3531
if: inputs.release_tag != '' && inputs.release_tag != 'unstable'
3632
id: ensure-branch
@@ -43,7 +39,7 @@ jobs:
4339
with:
4440
dist: ${{ matrix.dist }}
4541
release_tag: ${{ inputs.release_tag }}
46-
checkout_ref: ${{ inputs.checkout_ref || '' }}
42+
checkout_ref: ${{ inputs.release_tag == 'unstable' && 'unstable' || '' }}
4743

4844
build-binary-package:
4945
runs-on: ${{ contains(matrix.arch, 'arm') && 'ubuntu24-arm64-2-8' || 'ubuntu-24.04' }}
@@ -58,7 +54,7 @@ jobs:
5854
- name: Checkout code
5955
uses: actions/checkout@v4
6056
with:
61-
ref: ${{ inputs.checkout_ref || '' }}
57+
ref: ${{ inputs.release_tag == 'unstable' && 'unstable' || '' }}
6258
- name: Ensure Release Branch
6359
if: inputs.release_tag != '' && inputs.release_tag != 'unstable'
6460
id: ensure-branch
@@ -72,7 +68,7 @@ jobs:
7268
dist: ${{ matrix.dist }}
7369
arch: ${{ matrix.arch }}
7470
run_id: ${{ github.run_id }}
75-
checkout_ref: ${{ inputs.checkout_ref || '' }}
71+
checkout_ref: ${{ inputs.release_tag == 'unstable' && 'unstable' || '' }}
7672

7773
smoke-test-archs:
7874
runs-on: ubuntu-latest
@@ -103,10 +99,10 @@ jobs:
10399
- name: Checkout code
104100
uses: actions/checkout@v4
105101
with:
106-
ref: ${{ inputs.checkout_ref || '' }}
102+
ref: ${{ inputs.release_tag == 'unstable' && 'unstable' || '' }}
107103
- uses: ./.github/actions/run-smoke-tests
108104
with:
109105
image: ${{ matrix.image }}
110106
arch: ${{ matrix.arch }}
111107
run_id: ${{ github.run_id }}
112-
checkout_ref: ${{ inputs.checkout_ref || '' }}
108+
checkout_ref: ${{ inputs.release_tag == 'unstable' && 'unstable' || '' }}

0 commit comments

Comments
 (0)