Skip to content

Commit c2e45c8

Browse files
authored
Merge pull request #67 from OpenVoxProject/refactor
refactor: Add build platforms configuration and update agent version
2 parents 8023259 + ba1fa18 commit c2e45c8

9 files changed

Lines changed: 137 additions & 155 deletions

File tree

.github/workflows/build_container.yml

Lines changed: 43 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,64 @@
1+
---
12
name: Build and publish a 🛢️ container
23

34
on:
45
push:
56
branches:
67
- 'main'
78
tags:
8-
- '*'
9+
- 'v*'
910
workflow_dispatch:
1011

12+
concurrency:
13+
group: build-and-publish-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
permissions:
17+
contents: read # minimal required permissions to clone repo
18+
1119
jobs:
1220
setup-matrix:
1321
runs-on: ubuntu-latest
1422
outputs:
15-
matrix: ${{ steps.set-matrix.outputs.matrix }}
23+
build_matrix: ${{ steps.set-build-matrix.outputs.build_matrix }}
24+
tag_matrix: ${{ steps.set-tag-matrix.outputs.tag_matrix }}
1625
steps:
1726
- name: Source checkout
1827
uses: actions/checkout@v6
1928

2029
- name: 'Setup yq'
2130
uses: dcarbone/install-yq-action@v1.3.1
2231

23-
- id: set-matrix
24-
run: echo "matrix=$(yq -o json build_versions.yaml | jq -c)" >> $GITHUB_OUTPUT
32+
- id: set-build-matrix
33+
run: echo "build_matrix=$(bash matrix.sh build)" >> $GITHUB_OUTPUT
2534

26-
build-X86-container:
27-
runs-on: ubuntu-24.04
28-
permissions:
29-
contents: read
30-
packages: write
31-
needs: setup-matrix
32-
strategy:
33-
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
34-
steps:
35-
- name: Build OpenVox Server ${{ matrix.release }} container
36-
uses: voxpupuli/gha-build-and-publish-a-container@v2
37-
with:
38-
registry_password: ${{ secrets.GITHUB_TOKEN }}
39-
build_args: |
40-
OPENVOX_RELEASE=${{ matrix.release }}
41-
OPENVOXAGENT_VERSION=${{ matrix.agent_version }}
42-
build_arch: linux/amd64
43-
build_context: .
44-
buildfile: Containerfile
45-
tags: |
46-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-x86_64
35+
- id: set-tag-matrix
36+
run: echo "tag_matrix=$(bash matrix.sh tag)" >> $GITHUB_OUTPUT
4737

48-
build-ARM-container:
49-
runs-on: ubuntu-24.04-arm
38+
build-and-push-container:
39+
runs-on: ${{ matrix.runner }}
5040
permissions:
5141
contents: read
5242
packages: write
5343
needs: setup-matrix
5444
strategy:
55-
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
45+
matrix: ${{ fromJson(needs.setup-matrix.outputs.build_matrix) }}
5646
steps:
57-
- name: Build OpenVox Server ${{ matrix.release }} container
47+
- name: Checkout repository
48+
uses: actions/checkout@v6
49+
50+
- name: Build ${{ matrix.platform }} container
5851
uses: voxpupuli/gha-build-and-publish-a-container@v2
5952
with:
6053
registry_password: ${{ secrets.GITHUB_TOKEN }}
6154
build_args: |
6255
OPENVOX_RELEASE=${{ matrix.release }}
6356
OPENVOXAGENT_VERSION=${{ matrix.agent_version }}
64-
build_arch: linux/arm64
57+
build_arch: linux/${{ matrix.platform }}
6558
build_context: .
6659
buildfile: Containerfile
67-
tags: |
68-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-arm64
60+
# tag will look like: ghcr.io/openvoxproject/openvoxagent:8-<sha>-amd64
61+
tags: ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-${{ matrix.platform }}
6962

7063
create-multi-arch-manifests:
7164
runs-on: ubuntu-latest
@@ -74,10 +67,9 @@ jobs:
7467
packages: write
7568
needs:
7669
- setup-matrix
77-
- build-X86-container
78-
- build-ARM-container
70+
- build-and-push-container
7971
strategy:
80-
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
72+
matrix: ${{ fromJson(needs.setup-matrix.outputs.tag_matrix) }}
8173
steps:
8274
- name: Log in to the ghcr.io registry
8375
uses: docker/login-action@v4
@@ -93,57 +85,26 @@ jobs:
9385
username: voxpupulibot
9486
password: ${{ secrets.DOCKERHUB_BOT_ADMIN_TOKEN }}
9587

96-
- name: Extract version number
97-
id: extract_version
98-
uses: actions/github-script@v9
99-
with:
100-
script: |
101-
const agentVersion = '${{ matrix.agent_version }}';
102-
const version = agentVersion.split('-')[0];
103-
core.setOutput('version', version);
104-
105-
- name: Create multi arch manifests
88+
- name: Create ref-specific multi-arch manifests
10689
run: |
107-
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxagent:${{ steps.extract_version.outputs.version }}-${{ github.ref_name }} \
108-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-arm64 \
109-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-x86_64
110-
111-
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxagent:${{ steps.extract_version.outputs.version }}-latest \
112-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-arm64 \
113-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-x86_64
114-
115-
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-latest \
116-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-arm64 \
117-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-x86_64
118-
119-
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }} \
120-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-arm64 \
121-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-x86_64
122-
123-
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxagent:latest \
90+
docker buildx imagetools create \
91+
-t ghcr.io/openvoxproject/openvoxagent:${{ matrix.agent_semver }}-${{ github.ref_name }} \
92+
-t ghcr.io/openvoxproject/openvoxagent:${{ matrix.agent_semver }} \
93+
-t ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }} \
94+
-t docker.io/voxpupuli/openvoxagent:${{ matrix.agent_semver }}-${{ github.ref_name }} \
95+
-t docker.io/voxpupuli/openvoxagent:${{ matrix.agent_semver }} \
96+
-t docker.io/voxpupuli/openvoxagent:${{ matrix.release }} \
12497
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-arm64 \
125-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-x86_64
98+
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-amd64
12699
127-
# on docker.io we use the voxpupuli namespace because new organizations are not free anymore
128-
docker buildx imagetools create -t docker.io/voxpupuli/openvoxagent:${{ steps.extract_version.outputs.version }}-${{ github.ref_name }} \
129-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-arm64 \
130-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-x86_64
131-
132-
docker buildx imagetools create -t docker.io/voxpupuli/openvoxagent:${{ steps.extract_version.outputs.version }}-latest \
133-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-arm64 \
134-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-x86_64
135-
136-
docker buildx imagetools create -t docker.io/voxpupuli/openvoxagent:${{ matrix.release }}-latest \
137-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-arm64 \
138-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-x86_64
139-
140-
docker buildx imagetools create -t docker.io/voxpupuli/openvoxagent:${{ matrix.release }} \
141-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-arm64 \
142-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-x86_64
143-
144-
docker buildx imagetools create -t docker.io/voxpupuli/openvoxagent:latest \
100+
- name: Update floating multi-arch tags
101+
if: github.ref == 'refs/heads/main'
102+
run: |
103+
docker buildx imagetools create \
104+
-t ghcr.io/openvoxproject/openvoxagent:latest \
105+
-t docker.io/voxpupuli/openvoxagent:latest \
145106
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-arm64 \
146-
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-x86_64
107+
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-amd64
147108
148109
update-dockerhub-description:
149110
runs-on: ubuntu-latest

.github/workflows/ci.yaml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
11
---
2-
name: CI🚦
2+
name: 🚦 CI
33

44
on:
55
pull_request:
66
branches:
77
- 'main'
88
workflow_dispatch:
99

10+
concurrency:
11+
group: ci-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read # minimal required permissions to clone repo
16+
1017
jobs:
1118
setup-matrix:
1219
runs-on: ubuntu-latest
1320
outputs:
14-
matrix: ${{ steps.set-matrix.outputs.matrix }}
21+
build_matrix: ${{ steps.set-build-matrix.outputs.build_matrix }}
1522
steps:
1623
- name: Source checkout
1724
uses: actions/checkout@v6
1825

1926
- name: 'Setup yq'
2027
uses: dcarbone/install-yq-action@v1.3.1
2128

22-
- id: set-matrix
23-
run: echo "matrix=$(yq -o json build_versions.yaml | jq -c)" >> $GITHUB_OUTPUT
29+
- id: set-build-matrix
30+
run: echo "build_matrix=$(bash matrix.sh build)" >> $GITHUB_OUTPUT
2431

25-
build_test_container:
26-
name: 'Build test container'
27-
runs-on: ubuntu-latest
32+
build_ci_container:
33+
name: Build ${{ matrix.platform }} CI container
34+
runs-on: ${{ matrix.runner }}
2835
needs: setup-matrix
2936
strategy:
30-
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
37+
fail-fast: false
38+
matrix: ${{ fromJson(needs.setup-matrix.outputs.build_matrix) }}
3139
steps:
3240
- name: Checkout repository
3341
uses: actions/checkout@v6
3442

35-
- name: Extract version number
36-
id: extract_version
37-
uses: actions/github-script@v9
38-
with:
39-
script: |
40-
const agentVersion = '${{ matrix.agent_version }}';
41-
const version = agentVersion.split('-')[0];
42-
core.setOutput('version', version);
43-
44-
- name: Build image
43+
- name: Build ${{ matrix.platform }} CI container
4544
uses: docker/build-push-action@v7
4645
with:
47-
tags: 'ci/openvoxagent:${{ steps.extract_version.outputs.version }}'
46+
tags: ci/openvoxagent:${{ matrix.agent_semver }}-${{ matrix.platform }}
4847
context: .
4948
file: Containerfile
5049
push: false
50+
platforms: linux/${{ matrix.platform }}
5151
build-args: |
5252
OPENVOX_RELEASE=${{ matrix.release }}
5353
OPENVOXAGENT_VERSION=${{ matrix.agent_version }}
5454
5555
tests:
5656
needs:
57-
- build_test_container
57+
- build_ci_container
5858
runs-on: ubuntu-latest
5959
name: Test suite
6060
steps:
@@ -63,11 +63,12 @@ jobs:
6363
dependabot:
6464
permissions:
6565
contents: write
66+
pull-requests: write
6667
name: 'Dependabot auto-merge'
6768
needs:
6869
- tests
6970
runs-on: ubuntu-latest
70-
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
71+
if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'
7172
steps:
7273
- name: Dependabot metadata
7374
id: metadata
@@ -79,4 +80,4 @@ jobs:
7980
run: gh pr merge --auto --merge "$PR_URL"
8081
env:
8182
PR_URL: ${{github.event.pull_request.html_url}}
82-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
83+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/security_scanning.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,51 +9,52 @@ on:
99
branches:
1010
- main
1111

12+
concurrency:
13+
group: security-scanning-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
15+
16+
permissions:
17+
contents: read # minimal required permissions to clone repo
18+
1219
jobs:
1320
setup-matrix:
1421
runs-on: ubuntu-latest
1522
outputs:
16-
matrix: ${{ steps.set-matrix.outputs.matrix }}
23+
build_matrix: ${{ steps.set-build-matrix.outputs.build_matrix }}
1724
steps:
1825
- name: Source checkout
1926
uses: actions/checkout@v6
2027

2128
- name: 'Setup yq'
2229
uses: dcarbone/install-yq-action@v1.3.1
2330

24-
- id: set-matrix
25-
run: echo "matrix=$(yq -o json build_versions.yaml | jq -c)" >> $GITHUB_OUTPUT
31+
- id: set-build-matrix
32+
run: echo "build_matrix=$(bash matrix.sh build)" >> $GITHUB_OUTPUT
2633

2734
scan_ci_container:
28-
name: 'Scan CI container'
29-
runs-on: ubuntu-latest
35+
name: 'Scan ${{ matrix.platform }} CI container'
36+
runs-on: ${{ matrix.runner }}
3037
permissions:
3138
actions: read
3239
contents: read
3340
security-events: write
3441
needs: setup-matrix
3542
strategy:
36-
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
43+
fail-fast: false
44+
matrix: ${{ fromJson(needs.setup-matrix.outputs.build_matrix) }}
3745
steps:
3846
- name: Checkout repository
3947
uses: actions/checkout@v6
4048

41-
- name: Extract version number
42-
id: extract_version
43-
uses: actions/github-script@v9
44-
with:
45-
script: |
46-
const agentVersion = '${{ matrix.agent_version }}';
47-
const version = agentVersion.split('-')[0];
48-
core.setOutput('version', version);
49-
50-
- name: Build CI container
49+
- name: Build ${{ matrix.platform }} CI container
5150
uses: docker/build-push-action@v7
5251
with:
53-
tags: 'ci/openvoxagent:${{ steps.extract_version.outputs.version }}'
52+
tags: ci/openvoxagent:${{ matrix.agent_semver }}-${{ matrix.platform }}
5453
context: .
5554
file: Containerfile
55+
load: true
5656
push: false
57+
platforms: linux/${{ matrix.platform }}
5758
build-args: |
5859
OPENVOX_RELEASE=${{ matrix.release }}
5960
OPENVOXAGENT_VERSION=${{ matrix.agent_version }}
@@ -62,7 +63,7 @@ jobs:
6263
uses: anchore/scan-action@v7
6364
id: scan
6465
with:
65-
image: 'ci/openvoxagent:${{ steps.extract_version.outputs.version }}'
66+
image: 'ci/openvoxagent:${{ matrix.agent_semver }}-${{ matrix.platform }}'
6667
fail-build: false
6768

6869
- name: Inspect action SARIF report
@@ -72,3 +73,4 @@ jobs:
7273
uses: github/codeql-action/upload-sarif@v4
7374
with:
7475
sarif_file: ${{ steps.scan.outputs.sarif }}
76+
category: grype-${{ matrix.platform }}

Containerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
FROM ubuntu:26.04
1+
ARG UBUNTU_VERSION=26.04
22

3+
FROM ubuntu:${UBUNTU_VERSION} AS base
4+
5+
ARG UBUNTU_VERSION
36
ARG OPENVOX_RELEASE=8
47
ARG OPENVOX_USER_UID=999
58
ARG OPENVOX_USER_GID=999
6-
ARG UBUNTU_VERSION=24.04
7-
ARG OPENVOXAGENT_VERSION=8.11.0-1+ubuntu${UBUNTU_VERSION}
9+
# renovate: datasource=deb depName=openvox-agent openVoxRelease=8
10+
ARG OPENVOXAGENT_VERSION=8.28.0-1+ubuntu26.04
811
ARG OPENVOX_RELEASE_PACKAGE=openvox${OPENVOX_RELEASE}-release-ubuntu${UBUNTU_VERSION}.deb
912

1013
ADD https://apt.voxpupuli.org/${OPENVOX_RELEASE_PACKAGE} /

0 commit comments

Comments
 (0)