Skip to content

Commit 1c87794

Browse files
committed
Revert "github: stop publishing rtp.io images to GHCR"
This reverts commit a25c3fb.
1 parent 2cd2a45 commit 1c87794

2 files changed

Lines changed: 127 additions & 2 deletions

File tree

.github/workflows/.rtp.io.yml

Lines changed: 122 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
llvm-version-old:
1010
required: true
1111
type: string
12+
ghcr-repo:
13+
required: false
14+
type: string
15+
default: ghcr.io/${{ github.repository_owner }}/opensips
1216
rtpp-repo:
1317
required: false
1418
type: string
@@ -29,6 +33,8 @@ jobs:
2933
build-matrix: ${{ steps.set-env.outputs.build-matrix }}
3034
test-matrix: ${{ steps.set-env.outputs.test-matrix }}
3135
build-os: ${{ steps.set-env.outputs.build-os }}
36+
build-image: ${{ steps.set-env.outputs.build-image }}
37+
git-branch: ${{ steps.set-env.outputs.git-branch }}
3238
steps:
3339
- uses: actions/checkout@v4
3440

@@ -40,6 +46,10 @@ jobs:
4046
jq -r '.manifests[] | "\(.platform.os)/\(.platform.architecture)\(if .platform.variant != null then "/\(.platform.variant)" else "" end)"' | \
4147
sort -u | grep -v unknown | BUILD_OS="${BUILD_OS}" ./scripts/build/get-arch-buildargs.rtp.io fltplatforms | paste -sd ','`"
4248
BUILD_MATRIX="`echo ${PLATFORMS} | tr ',' '\n' | jq -R . | jq -s . | tr '\n' ' '`"
49+
GIT_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
50+
GIT_BRANCH="${GIT_BRANCH#refs/tags/}"
51+
BI_BRANCH="`echo ${GIT_BRANCH} | sed 's~/~_~g'`"
52+
BUILD_IMAGE="${{ inputs.ghcr-repo }}:rtp.io-${{ inputs.rtpp-tag }}-${BI_BRANCH}"
4353
echo "Platforms: ${PLATFORMS}"
4454
for _p in `echo ${PLATFORMS} | tr ',' '\n'`; \
4555
do \
@@ -53,11 +63,75 @@ jobs:
5363
echo "build-matrix=${BUILD_MATRIX}" >> $GITHUB_OUTPUT
5464
echo "test-matrix=${TEST_MATRIX}" >> $GITHUB_OUTPUT
5565
echo "build-os=${BUILD_OS}" >> $GITHUB_OUTPUT
66+
echo "build-image=${BUILD_IMAGE}" >> $GITHUB_OUTPUT
67+
echo "git-branch=${GIT_BRANCH}" >> $GITHUB_OUTPUT
5668
5769
build_rtp_io_dock:
58-
name: Build Container (LOCAL)
70+
name: Build Container (GHCR)
71+
needs: set_env
72+
runs-on: ubuntu-latest
73+
if: ${{ github.event_name != 'pull_request' }}
74+
permissions:
75+
packages: write
76+
env:
77+
BASE_IMAGE: ${{ inputs.rtpp-repo }}-${{ inputs.rtpp-tag }}
78+
BUILD_OS: ${{ needs.set_env.outputs.build-os }}
79+
PLATFORMS: ${{ needs.set_env.outputs.platforms }}
80+
BUILD_IMAGE: ${{ needs.set_env.outputs.build-image }}
81+
82+
steps:
83+
- uses: actions/checkout@v4
84+
with:
85+
submodules: recursive
86+
87+
- name: Checkout VoIPTests repo
88+
uses: actions/checkout@v4
89+
with:
90+
repository: 'sippy/voiptests'
91+
path: dist/voiptests
92+
93+
- name: Checkout RTPProxy repo
94+
uses: actions/checkout@v4
95+
with:
96+
repository: 'sippy/rtpproxy'
97+
path: dist/rtpproxy
98+
99+
- name: Set up QEMU
100+
uses: docker/setup-qemu-action@v3
101+
102+
- name: Set up Docker Buildx
103+
uses: docker/setup-buildx-action@v3
104+
105+
- name: Login to GitHub Container Registry
106+
uses: docker/login-action@v3
107+
with:
108+
registry: ghcr.io
109+
username: ${{ github.repository_owner }}
110+
password: ${{ secrets.GITHUB_TOKEN }}
111+
112+
- name: Build Docker image
113+
uses: docker/build-push-action@v6
114+
env:
115+
CACHE_SPEC: "type=registry,ref=${{ env.BUILD_IMAGE }}-buildcache"
116+
with:
117+
context: .
118+
file: ./docker/Dockerfile.rtp.io
119+
build-args: |
120+
BASE_IMAGE=${{ env.BASE_IMAGE }}
121+
BUILD_OS=${{ env.BUILD_OS }}
122+
LLVM_VER=${{ inputs.llvm-version }}
123+
LLVM_VER_OLD=${{ inputs.llvm-version-old }}
124+
platforms: ${{ env.PLATFORMS }}
125+
cache-from: ${{ env.CACHE_SPEC }}
126+
cache-to: ${{ env.CACHE_SPEC }},mode=max
127+
tags: ${{ env.BUILD_IMAGE }}
128+
push: true
129+
130+
build_rtp_io_dock_local:
131+
name: Build Container (Local)
59132
needs: set_env
60133
runs-on: ubuntu-latest
134+
if: ${{ github.event_name == 'pull_request' }}
61135
strategy:
62136
fail-fast: false
63137
matrix:
@@ -128,15 +202,61 @@ jobs:
128202
path: ${{ env.OUTPUT_IMAGE }}
129203

130204
test_rtp_io_dock:
131-
name: Run VoIPTests™ (LOCAL)
205+
name: Run VoIPTests™ (GHCR)
132206
needs: [build_rtp_io_dock, set_env]
133207
runs-on: ubuntu-latest
208+
if: ${{ github.event_name != 'pull_request' }}
209+
permissions:
210+
packages: read
211+
strategy:
212+
fail-fast: false
213+
matrix:
214+
platform: ${{ fromJSON(needs.set_env.outputs.test-matrix) }}
215+
env:
216+
TARGETPLATFORM: ${{ matrix.platform }}
217+
BUILD_IMAGE: ${{ needs.set_env.outputs.build-image }}
218+
BUILD_OS: ${{ needs.set_env.outputs.build-os }}
219+
220+
steps:
221+
- name: Set up QEMU
222+
if: matrix.platform != 'linux/386' && matrix.platform != 'linux/amd64'
223+
uses: docker/setup-qemu-action@v3
224+
with:
225+
platforms: ${{ env.TARGETPLATFORM }}
226+
227+
- name: Login to GitHub Container Registry
228+
uses: docker/login-action@v3
229+
with:
230+
registry: ghcr.io
231+
username: ${{ github.repository_owner }}
232+
password: ${{ secrets.GITHUB_TOKEN }}
233+
234+
- name: Set dynamic environment
235+
run: |
236+
if [ "${TARGETPLATFORM}" != "linux/amd64" ]
237+
then
238+
echo "TEST_SET_MIGHTFAIL=early_cancel_lost100,early_cancel" >> $GITHUB_ENV
239+
fi
240+
241+
- name: Test ${{ env.TARGETPLATFORM }}
242+
run: |
243+
docker pull ${BUILD_IMAGE}
244+
docker run --platform ${TARGETPLATFORM} --env TEST_SET_MIGHTFAIL --name test --cap-add=SYS_PTRACE \
245+
--privileged --sysctl net.ipv6.conf.all.disable_ipv6=0 ${BUILD_IMAGE}
246+
timeout-minutes: 3
247+
248+
test_rtp_io_local:
249+
name: Run VoIPTests™ (LOCAL)
250+
needs: [build_rtp_io_dock_local, set_env]
251+
runs-on: ubuntu-latest
252+
if: ${{ github.event_name == 'pull_request' }}
134253
strategy:
135254
fail-fast: false
136255
matrix:
137256
platform: ${{ fromJSON(needs.set_env.outputs.test-matrix) }}
138257
env:
139258
TARGETPLATFORM: ${{ matrix.platform }}
259+
BUILD_IMAGE: ${{ needs.set_env.outputs.build-image }}
140260
BUILD_OS: ${{ needs.set_env.outputs.build-os }}
141261

142262
steps:

.github/workflows/rtp.io.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
env:
1515
LLVM_VER: 19
1616
LLVM_VER_OLD: 16
17+
GHCR_REPO: ghcr.io/${{ github.repository_owner }}/opensips
1718

1819
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1920
jobs:
@@ -30,6 +31,7 @@ jobs:
3031
outputs:
3132
llvm_ver: ${{ steps.set_outputs.outputs.LLVM_VER }}
3233
llvm_ver_old: ${{ steps.set_outputs.outputs.LLVM_VER_OLD }}
34+
ghcr-repo: ${{ steps.set_outputs.outputs.GHCR_REPO }}
3335

3436
steps:
3537
- name: Set up environment
@@ -112,6 +114,8 @@ jobs:
112114
run: |
113115
echo "LLVM_VER=${LLVM_VER}" >> $GITHUB_OUTPUT
114116
echo "LLVM_VER_OLD=${LLVM_VER_OLD}" >> $GITHUB_OUTPUT
117+
GHCR_REPO="ghcr.io/${{ github.repository_owner }}/opensips"
118+
echo "GHCR_REPO=${GHCR_REPO}" | tr '[:upper:]' '[:lower:]' >> $GITHUB_OUTPUT
115119
116120
build_test_rtp_io_dock:
117121
name: Build & Test OpenSIPS+rtp.io
@@ -121,6 +125,7 @@ jobs:
121125
rtpp-tag: ${{ matrix.rtpp-tag }}
122126
llvm-version: ${{ needs.build_test_rtp_io_quick.outputs.llvm_ver }}
123127
llvm-version-old: ${{ needs.build_test_rtp_io_quick.outputs.llvm_ver_old }}
128+
ghcr-repo: ${{ needs.build_test_rtp_io_quick.outputs.ghcr-repo }}
124129
strategy:
125130
fail-fast: false
126131
matrix:

0 commit comments

Comments
 (0)