Skip to content

Commit fb01cb3

Browse files
committed
Implement upload actions, with intrinsic login method
Signed-off-by: Brett T. Warden <bwarden@qti.qualcomm.com>
1 parent 9c53e77 commit fb01cb3

4 files changed

Lines changed: 16 additions & 59 deletions

File tree

.github/actions/build_deb_container/action.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,6 @@ name: Build Debian Containers
22
description: |
33
Builds the Debian-based containers (noble, questing, resolute, trixie, sid).
44
5-
inputs:
6-
7-
arch:
8-
description: The architecture to build for. Ex amd64, arm64, etc
9-
required: true
10-
11-
push-to-ghcr:
12-
description: Whether to push the built image to GitHub Container Registry
13-
required: true
14-
default: "true"
15-
16-
token:
17-
description: PAT token
18-
required: true
19-
20-
username:
21-
description: Username for the PAT token
22-
required: true
23-
245
runs:
256
using: "composite"
267

.github/actions/build_rpm_container/action.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,6 @@ name: Build RPM Containers
22
description: |
33
Builds the RPM-based containers.
44
5-
inputs:
6-
7-
arch:
8-
description: The architecture to build for. Ex amd64, arm64, etc
9-
required: true
10-
11-
push-to-ghcr:
12-
description: Whether to push the built image to GitHub Container Registry
13-
required: true
14-
default: "true"
15-
16-
token:
17-
description: PAT token
18-
required: true
19-
20-
username:
21-
description: Username for the PAT token
22-
required: true
23-
245
runs:
256
using: "composite"
267

.github/actions/upload_containers/action.yml

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,8 @@ description: |
44
55
inputs:
66

7-
arch:
8-
description: The architecture to build for. Ex amd64, arm64, etc
9-
required: true
10-
11-
push-to-ghcr:
12-
description: Whether to push the built image to GitHub Container Registry
13-
required: true
14-
default: "true"
15-
16-
token:
17-
description: PAT token
18-
required: true
19-
20-
username:
21-
description: Username for the PAT token
7+
family:
8+
description: The distribution family to upload. Ex deb, rpm.
229
required: true
2310

2411
runs:
@@ -30,12 +17,10 @@ runs:
3017
if: ${{ github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
3118
uses: docker/login-action@v3
3219

33-
- name: Push to GHCR
34-
if: ${{ inputs.push-to-ghcr == 'true' }}
20+
- name: Push Debian container images to GHCR
21+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch') && inputs.family == 'deb' }}
3522
shell: bash
3623
run: |
37-
echo ${{inputs.token}} | docker login ghcr.io -u ${{inputs.username}} --password-stdin
38-
3924
# UBUNTU IMAGES
4025
docker push ghcr.io/${{env.QCOM_ORG_NAME}}/${{env.IMAGE_NAME}}:noble
4126
docker push ghcr.io/${{env.QCOM_ORG_NAME}}/${{env.IMAGE_NAME}}:questing
@@ -45,7 +30,10 @@ runs:
4530
docker push ghcr.io/${{env.QCOM_ORG_NAME}}/${{env.IMAGE_NAME}}:trixie
4631
docker push ghcr.io/${{env.QCOM_ORG_NAME}}/${{env.IMAGE_NAME}}:sid
4732
48-
# TODO RPM IMAGES
33+
- name: Push RPM container images to GHCR
34+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch') && inputs.family == 'rpm' }}
35+
shell: bash
36+
run: |
4937
for image in $(docker image ls | grep -oiE "ghcr.io/${{env.QCOM_ORG_NAME}}/${{env.IMAGE_NAME}}:(fedora|rhel|redhat|centos)\.[^\s]*"; do
5038
echo docker push ${image}
5139
done

.github/workflows/qcom-container-build-and-upload.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ jobs:
5252
- name: Build Debian Images
5353
uses: ./.github/actions/build_deb_container
5454

55-
- name: Upload Images
55+
- name: Upload Debian Images
5656
uses: ./.github/actions/upload_containers
57+
with:
58+
family: deb
5759

5860
build-rpm-arm64:
5961
runs-on: ubuntu-24.04-arm
@@ -63,3 +65,8 @@ jobs:
6365

6466
- name: Build RPM Images
6567
uses: ./.github/actions/build_rpm_container
68+
69+
- name: Upload RPM Images
70+
uses: ./.github/actions/upload_containers
71+
with:
72+
family: rpm

0 commit comments

Comments
 (0)