Skip to content

Commit 7977601

Browse files
authored
Merge pull request #104 from freeswitch/debian_trixie
[GHA] Add Debian `Trixie` build target
2 parents 0c6929b + 3009d46 commit 7977601

File tree

4 files changed

+352
-2
lines changed

4 files changed

+352
-2
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
ARG BUILDER_IMAGE=debian:trixie-20250520
2+
3+
FROM ${BUILDER_IMAGE} AS builder
4+
ARG MAINTAINER_NAME="Andrey Volk"
5+
ARG MAINTAINER_EMAIL="andrey@signalwire.com"
6+
7+
ARG CODENAME=trixie
8+
ARG ARCH=amd64
9+
10+
ARG BUILD_NUMBER=42
11+
ARG GIT_SHA=0000000000
12+
13+
ARG DATA_DIR=/data
14+
15+
LABEL maintainer="${MAINTAINER_NAME} <${MAINTAINER_EMAIL}>"
16+
17+
SHELL ["/bin/bash", "-c"]
18+
19+
ENV DEBIAN_FRONTEND=noninteractive
20+
21+
RUN apt-get -q update \
22+
&& apt-get -y -q install \
23+
apt-transport-https \
24+
autoconf \
25+
automake \
26+
build-essential \
27+
ca-certificates \
28+
cmake \
29+
curl \
30+
debhelper \
31+
devscripts \
32+
dh-autoreconf \
33+
docbook-xsl \
34+
dos2unix \
35+
doxygen \
36+
dpkg-dev \
37+
git \
38+
graphviz \
39+
libglib2.0-dev \
40+
libssl-dev \
41+
lsb-release \
42+
pkg-config \
43+
wget
44+
45+
RUN update-ca-certificates --fresh
46+
47+
RUN echo "export CODENAME=${CODENAME}" | tee ~/.env \
48+
&& echo "export ARCH=${ARCH}" | tee -a ~/.env \
49+
&& chmod +x ~/.env
50+
51+
RUN git config --global --add safe.directory '*' \
52+
&& git config --global user.name "${MAINTAINER_NAME}" \
53+
&& git config --global user.email "${MAINTAINER_EMAIL}"
54+
55+
# Bootstrap and Build
56+
COPY . ${DATA_DIR}
57+
WORKDIR ${DATA_DIR}
58+
59+
RUN echo "export VERSION=$(dpkg-parsechangelog --show-field Version | cut -f1 -d'-')" \
60+
| tee -a ~/.env
61+
62+
RUN apt-get -q update \
63+
&& mk-build-deps \
64+
--install \
65+
--remove debian/control \
66+
--tool "apt-get -y --no-install-recommends" \
67+
&& apt-get -y -f install
68+
69+
ENV DEB_BUILD_OPTIONS="parallel=1"
70+
71+
RUN . ~/.env \
72+
&& dch \
73+
--controlmaint \
74+
--distribution "${CODENAME}" \
75+
--force-bad-version \
76+
--force-distribution \
77+
--newversion "${VERSION}-${BUILD_NUMBER}-${GIT_SHA}~${CODENAME}" \
78+
"Nightly build, ${GIT_SHA}" \
79+
&& debuild \
80+
--no-tgz-check \
81+
--build=binary \
82+
--unsigned-source \
83+
--unsigned-changes \
84+
&& mkdir OUT \
85+
&& mv -v ../*.{deb,changes} OUT/.
86+
87+
# Artifacts image (mandatory part, the resulting image must have a single filesystem layer)
88+
FROM scratch
89+
COPY --from=builder /data/OUT/ /
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
ARG BUILDER_IMAGE=arm32v7/debian:trixie-20250520
2+
3+
FROM --platform=linux/arm/v7 ${BUILDER_IMAGE} AS builder
4+
5+
ARG MAINTAINER_NAME="Andrey Volk"
6+
ARG MAINTAINER_EMAIL="andrey@signalwire.com"
7+
8+
ARG CODENAME=trixie
9+
ARG ARCH=arm32
10+
11+
ARG BUILD_NUMBER=42
12+
ARG GIT_SHA=0000000000
13+
14+
ARG DATA_DIR=/data
15+
16+
LABEL maintainer="${MAINTAINER_NAME} <${MAINTAINER_EMAIL}>"
17+
18+
SHELL ["/bin/bash", "-c"]
19+
20+
ENV DEBIAN_FRONTEND=noninteractive
21+
22+
RUN apt-get -q update \
23+
&& apt-get -y -q install \
24+
apt-transport-https \
25+
autoconf \
26+
automake \
27+
build-essential \
28+
ca-certificates \
29+
cmake \
30+
curl \
31+
debhelper \
32+
devscripts \
33+
dh-autoreconf \
34+
docbook-xsl \
35+
dos2unix \
36+
doxygen \
37+
dpkg-dev \
38+
git \
39+
graphviz \
40+
libglib2.0-dev \
41+
libssl-dev \
42+
lsb-release \
43+
pkg-config \
44+
wget
45+
46+
RUN update-ca-certificates --fresh
47+
48+
RUN echo "export CODENAME=${CODENAME}" | tee ~/.env \
49+
&& echo "export ARCH=${ARCH}" | tee -a ~/.env \
50+
&& chmod +x ~/.env
51+
52+
RUN git config --global --add safe.directory '*' \
53+
&& git config --global user.name "${MAINTAINER_NAME}" \
54+
&& git config --global user.email "${MAINTAINER_EMAIL}"
55+
56+
# Bootstrap and Build
57+
COPY . ${DATA_DIR}
58+
WORKDIR ${DATA_DIR}
59+
60+
RUN echo "export VERSION=$(dpkg-parsechangelog --show-field Version | cut -f1 -d'-')" \
61+
| tee -a ~/.env
62+
63+
RUN apt-get -q update \
64+
&& mk-build-deps \
65+
--install \
66+
--remove debian/control \
67+
--tool "apt-get -y --no-install-recommends" \
68+
&& apt-get -y -f install
69+
70+
ENV DEB_BUILD_OPTIONS="parallel=1"
71+
72+
RUN . ~/.env \
73+
&& dch \
74+
--controlmaint \
75+
--distribution "${CODENAME}" \
76+
--force-bad-version \
77+
--force-distribution \
78+
--newversion "${VERSION}-${BUILD_NUMBER}-${GIT_SHA}~${CODENAME}" \
79+
"Nightly build, ${GIT_SHA}" \
80+
&& debuild \
81+
--no-tgz-check \
82+
--build=binary \
83+
--unsigned-source \
84+
--unsigned-changes \
85+
&& mkdir OUT \
86+
&& mv -v ../*.{deb,changes} OUT/.
87+
88+
# Artifacts image (mandatory part, the resulting image must have a single filesystem layer)
89+
FROM scratch
90+
COPY --from=builder /data/OUT/ /
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
ARG BUILDER_IMAGE=arm64v8/debian:trixie-20250520
2+
3+
FROM --platform=linux/arm64 ${BUILDER_IMAGE} AS builder
4+
5+
ARG MAINTAINER_NAME="Andrey Volk"
6+
ARG MAINTAINER_EMAIL="andrey@signalwire.com"
7+
8+
ARG CODENAME=trixie
9+
ARG ARCH=arm64
10+
11+
ARG BUILD_NUMBER=42
12+
ARG GIT_SHA=0000000000
13+
14+
ARG DATA_DIR=/data
15+
16+
LABEL maintainer="${MAINTAINER_NAME} <${MAINTAINER_EMAIL}>"
17+
18+
SHELL ["/bin/bash", "-c"]
19+
20+
ENV DEBIAN_FRONTEND=noninteractive
21+
22+
RUN apt-get -q update \
23+
&& apt-get -y -q install \
24+
apt-transport-https \
25+
autoconf \
26+
automake \
27+
build-essential \
28+
ca-certificates \
29+
cmake \
30+
curl \
31+
debhelper \
32+
devscripts \
33+
dh-autoreconf \
34+
docbook-xsl \
35+
dos2unix \
36+
doxygen \
37+
dpkg-dev \
38+
git \
39+
graphviz \
40+
libglib2.0-dev \
41+
libssl-dev \
42+
lsb-release \
43+
pkg-config \
44+
wget
45+
46+
RUN update-ca-certificates --fresh
47+
48+
RUN echo "export CODENAME=${CODENAME}" | tee ~/.env \
49+
&& echo "export ARCH=${ARCH}" | tee -a ~/.env \
50+
&& chmod +x ~/.env
51+
52+
RUN git config --global --add safe.directory '*' \
53+
&& git config --global user.name "${MAINTAINER_NAME}" \
54+
&& git config --global user.email "${MAINTAINER_EMAIL}"
55+
56+
# Bootstrap and Build
57+
COPY . ${DATA_DIR}
58+
WORKDIR ${DATA_DIR}
59+
60+
RUN echo "export VERSION=$(dpkg-parsechangelog --show-field Version | cut -f1 -d'-')" \
61+
| tee -a ~/.env
62+
63+
RUN apt-get -q update \
64+
&& mk-build-deps \
65+
--install \
66+
--remove debian/control \
67+
--tool "apt-get -y --no-install-recommends" \
68+
&& apt-get -y -f install
69+
70+
ENV DEB_BUILD_OPTIONS="parallel=1"
71+
72+
RUN . ~/.env \
73+
&& dch \
74+
--controlmaint \
75+
--distribution "${CODENAME}" \
76+
--force-bad-version \
77+
--force-distribution \
78+
--newversion "${VERSION}-${BUILD_NUMBER}-${GIT_SHA}~${CODENAME}" \
79+
"Nightly build, ${GIT_SHA}" \
80+
&& debuild \
81+
--no-tgz-check \
82+
--build=binary \
83+
--unsigned-source \
84+
--unsigned-changes \
85+
&& mkdir OUT \
86+
&& mv -v ../*.{deb,changes} OUT/.
87+
88+
# Artifacts image (mandatory part, the resulting image must have a single filesystem layer)
89+
FROM scratch
90+
COPY --from=builder /data/OUT/ /

.github/workflows/build.yml

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: Build and Distribute
22

33
on:
44
pull_request:
@@ -26,6 +26,7 @@ jobs:
2626
os:
2727
- debian
2828
version:
29+
- trixie
2930
- bookworm
3031
- bullseye
3132
platform:
@@ -43,10 +44,90 @@ jobs:
4344
META_FILE_PATH_PREFIX: /var/www/spandsp/public/unstable/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}
4445
PLATFORM: ${{ matrix.platform.name }}
4546
TARGET_ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-unstable-artifact
46-
UPLOAD_BUILD_ARTIFACTS: false
47+
UPLOAD_BUILD_ARTIFACTS: ${{ github.event_name != 'pull_request' }}
4748
secrets:
4849
GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }}
4950
HOSTNAME: ${{ secrets.HOSTNAME }}
5051
PROXY_URL: ${{ secrets.PROXY_URL }}
5152
USERNAME: ${{ secrets.USERNAME }}
5253
TELEPORT_TOKEN: ${{ secrets.TELEPORT_TOKEN }}
54+
55+
deb-mirror:
56+
name: 'DEB-MIRROR'
57+
if: ${{ github.event_name != 'pull_request' }}
58+
needs:
59+
- deb
60+
runs-on: ubuntu-latest
61+
permissions:
62+
id-token: write
63+
contents: read
64+
strategy:
65+
# max-parallel: 1
66+
fail-fast: false
67+
matrix:
68+
os:
69+
- debian
70+
version:
71+
- trixie
72+
- bookworm
73+
- bullseye
74+
platform:
75+
- name: amd64
76+
runner: ubuntu-latest
77+
- name: arm32v7
78+
runner: ubuntu-24.04-arm
79+
- name: arm64v8
80+
runner: ubuntu-24.04-arm
81+
release:
82+
- release
83+
- unstable
84+
steps:
85+
- name: Checkout reusable actions
86+
uses: actions/checkout@v4
87+
with:
88+
repository: signalwire/actions-template
89+
ref: main
90+
fetch-depth: 1
91+
path: actions
92+
sparse-checkout: |
93+
.github/actions/teleport-local-copy/action.yml
94+
sparse-checkout-cone-mode: false
95+
96+
- name: Mirror artifacts on remote server behind Teleport (public)
97+
uses: ./actions/.github/actions/teleport-local-copy
98+
with:
99+
SRC: '/var/www/spandsp/public/unstable/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}/${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-unstable-artifact.tar.gz'
100+
DST: '/var/www/spandsp/public/${{ matrix.release }}/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}/${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-${{ matrix.release }}-artifact.tar.gz'
101+
env:
102+
HOSTNAME: ${{ secrets.HOSTNAME }}
103+
PROXY_URL: ${{ secrets.PROXY_URL }}
104+
TOKEN: ${{ secrets.TELEPORT_TOKEN }}
105+
USERNAME: ${{ secrets.USERNAME }}
106+
107+
- name: Mirror artifacts on remote server behind Teleport (fsa)
108+
uses: ./actions/.github/actions/teleport-local-copy
109+
with:
110+
SRC: '/var/www/spandsp/public/unstable/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}/${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-unstable-artifact.tar.gz'
111+
DST: '/var/www/spandsp/fsa/${{ matrix.release }}/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}/${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-fsa-${{ matrix.release }}-artifact.tar.gz'
112+
env:
113+
HOSTNAME: ${{ secrets.HOSTNAME }}
114+
PROXY_URL: ${{ secrets.PROXY_URL }}
115+
TOKEN: ${{ secrets.TELEPORT_TOKEN }}
116+
USERNAME: ${{ secrets.USERNAME }}
117+
118+
meta:
119+
name: 'Publish build data to meta-repo'
120+
if: ${{ github.event_name != 'pull_request' }}
121+
needs:
122+
- deb
123+
- deb-mirror
124+
permissions:
125+
id-token: write
126+
contents: read
127+
uses: signalwire/actions-template/.github/workflows/meta-repo-content.yml@main
128+
with:
129+
META_CONTENT: '/var/www/spandsp/{fsa,public}/{release,unstable}/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}'
130+
META_REPO: signalwire/bamboo_gha_trigger
131+
META_REPO_BRANCH: trigger/spandsp/${{ github.ref_name }}
132+
secrets:
133+
GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }}

0 commit comments

Comments
 (0)