Skip to content

Commit 83dd41c

Browse files
Update workflows
Signed-off-by: Simon Beaudoin <sbeaudoi@qti.qualcomm.com>
1 parent 8a24612 commit 83dd41c

File tree

4 files changed

+92
-3
lines changed

4 files changed

+92
-3
lines changed

.github/workflows/build-debian-package.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ on:
3838
- lecore-prd-u2404-arm64-xlrg-od-ephem
3939

4040
permissions:
41-
contents: read
42-
security-events: write
41+
contents: read
4342

4443
jobs:
4544
build:
@@ -49,7 +48,7 @@ jobs:
4948
debian-ref: ${{ inputs.debian-ref }}
5049
distro-codename: ${{ inputs.distro-codename }}
5150
run-abi-checker: ${{ inputs.abi-checker }}
52-
push-to-repo: ${{ inputs.push-to-repo }}
51+
is-post-merge: ${{ inputs.push-to-repo }}
5352
runner: ${{inputs.builder_runner}}
5453
secrets:
5554
TOKEN: ${{ secrets.DEB_PKG_BOT_CI_TOKEN }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: PR Pre and Post Merge Build
2+
description: |
3+
Test a package build pre and post merge.
4+
When a PR is opened, synchronized or reopened against debian/latest, this workflow will test that the package builds successfully inside the PR.
5+
The user will want to mark this check as required in branch protection rules to ensure that PRs cannot be merged unless the package builds successfully.
6+
When a PR is closed AND merged, this workflow will test that debian/latest builds successfully and push the new package to the staging repo.
7+
This is controled by the is-post-merge input to the reusable workflow, which is set based on the PR action and merged status.
8+
This workflow will explicitely NOT run on closed but unmerged PRs to avoid unnecessary builds (say in the case of a declined PR)
9+
10+
on:
11+
pull_request_target:
12+
branches: [ debian/latest ]
13+
types: [ opened, synchronize, reopened, closed ]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
20+
build:
21+
22+
# This condition ensures that the job runs for all PR actions except closed unmerged,
23+
# i.e., it runs for opened, synchronize, reopened (pre-merge) and closed merged (post-merge).
24+
if: ${{ github.event.action != 'closed' || github.event.pull_request.merged == true }}
25+
uses: qualcomm-linux/qcom-build-utils/.github/workflows/qcom-build-pkg-reusable-workflow.yml@main
26+
with:
27+
qcom-build-utils-ref: main
28+
29+
# PRE-MERGE: use the PR head branch (github.head_ref)
30+
# POST-MERGE: use the base branch name from the PR (e.g. "debian/latest")
31+
debian-ref: ${{ (github.event.action == 'closed' && github.event.pull_request.merged) && github.event.pull_request.base.ref || github.head_ref }}
32+
run-abi-checker: true
33+
# True if the PR was merged (i.e. post-merge): closed & merged
34+
is-post-merge: ${{ github.event.action == 'closed' && github.event.pull_request.merged == true }}
35+
36+
secrets:
37+
TOKEN: ${{secrets.DEB_PKG_BOT_CI_TOKEN}}

.github/workflows/promote-upstream.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ on:
44
workflow_dispatch:
55
inputs:
66

7+
debian-branch:
8+
description: The debian branch to apply the promotion to. For example branch "debian/qcom-next"
9+
type: string
10+
required: false
11+
default: debian/qcom-next
12+
713
upstream-tag:
814
description: The upstream tag to promote this package repo to. Eg, v1.1.0 or 1.2.0, depending on the versioning style
915
type: string
@@ -19,6 +25,7 @@ jobs:
1925
uses: qualcomm-linux/qcom-build-utils/.github/workflows/qcom-promote-upstream-reusable-workflow.yml@main
2026
with:
2127
qcom-build-utils-ref: main
28+
debian-branch: ${{inputs.debian-branch}}
2229
upstream-tag: ${{inputs.upstream-tag}}
2330
upstream-repo: ${{vars.UPSTREAM_REPO_GITHUB_NAME}}
2431
secrets:

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release Version
2+
description: |
3+
Release a new package version.
4+
This workflow is manually triggered via workflow_dispatch.
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
10+
distro-codename:
11+
description: The distribution codename to build for. Ex noble, questing, etc
12+
type: choice
13+
default: noble
14+
options:
15+
- noble
16+
- questing
17+
18+
runner:
19+
type: choice
20+
default: ubuntu-latest
21+
options:
22+
- ubuntu-latest
23+
- lecore-prd-u2404-arm64-xlrg-od-ephem
24+
25+
test-run:
26+
description: |
27+
If true, the built packages will be uploaded to the 'test' folder in S3.
28+
If false, the built packages will be uploaded to the 'proposed' folder in S3
29+
type: boolean
30+
default: true
31+
32+
permissions:
33+
contents: write
34+
35+
jobs:
36+
release:
37+
38+
uses: qualcomm-linux/qcom-build-utils/.github/workflows/qcom-release-reusable-workflow.yml@main
39+
with:
40+
qcom-build-utils-ref: main
41+
distro-codename: ${{ github.event.inputs.distro-codename }}
42+
test-run: ${{ github.event.inputs.test-run == 'true' && true || false }}
43+
runner: ${{ github.event.inputs.runner }}
44+
45+
secrets:
46+
TOKEN: ${{secrets.DEB_PKG_BOT_CI_TOKEN}}

0 commit comments

Comments
 (0)