@@ -300,3 +300,109 @@ jobs:
300300 else
301301 echo "No changes to commit"
302302 fi
303+
304+ # -------------------------------------------------------------------------------------------------
305+ # Gubbins deployment
306+ # -------------------------------------------------------------------------------------------------
307+
308+ build-gubbins-wheels :
309+ name : Build wheels
310+ runs-on : " ubuntu-latest"
311+ needs : deploy-pypi
312+ if : ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
313+ defaults :
314+ run :
315+ # We need extglob for REFERENCE_BRANCH substitution
316+ shell : bash -l -O extglob {0}
317+ steps :
318+ - name : Checkout
319+ uses : actions/checkout@v4
320+ - uses : actions/setup-python@v5
321+ with :
322+ python-version : ' 3.11'
323+ - name : Installing dependencies
324+ run : |
325+ python -m pip install \
326+ build \
327+ python-dateutil \
328+ pytz \
329+ readme_renderer[md] \
330+ requests \
331+ setuptools_scm
332+ - name : Build distributions
333+ run : |
334+ # build the gubbins package
335+ for pkg_dir in $PWD/extensions/gubbins/gubbins-*; do
336+ # Skip the testing package
337+ if [[ "${pkg_dir}" =~ .*testing.* ]];
338+ then
339+ echo "Do not build ${pkg_dir}";
340+ continue;
341+ fi
342+ echo "Building $pkg_dir"
343+ python -m build --outdir $PWD/dist $pkg_dir
344+ done
345+ - name : ' Upload Artifact'
346+ uses : actions/upload-artifact@v4
347+ with :
348+ name : gubbins-whl
349+ path : dist/*.whl
350+ retention-days : 5
351+
352+ # Build to docker image with the code in it
353+ docker-gubbins :
354+ needs :
355+ - deploy-pypi
356+ - build-gubbins-wheels
357+ if : ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
358+ timeout-minutes : 30
359+ runs-on : ubuntu-latest
360+ steps :
361+ - name : Checkout
362+ uses : actions/checkout@v4
363+ - name : Set up QEMU
364+ uses : docker/setup-qemu-action@v3
365+ - name : Set up Docker Buildx
366+ uses : docker/setup-buildx-action@v3
367+ - name : Login to GitHub container registry
368+ uses : docker/login-action@v3
369+ with :
370+ registry : ghcr.io
371+ username : ${{ github.actor }}
372+ password : ${{ secrets.GITHUB_TOKEN }}
373+ - name : Download diracx wheels
374+ uses : actions/download-artifact@v4
375+ with :
376+ name : diracx-whl
377+ - name : Download gubbins wheels
378+ uses : actions/download-artifact@v4
379+ with :
380+ name : gubbins-whl
381+ - name : " Find wheels"
382+ id : find_wheel
383+ run : |
384+ # We need to copy them there to be able to access them in the RUN --mount
385+ cp diracx*.whl gubbins*.whl extensions/containers/client/
386+ cp diracx*.whl gubbins*.whl extensions/containers/services/
387+ for wheel_fn in *.whl; do
388+ pkg_name=$(basename "${wheel_fn}" | cut -d '-' -f 1)
389+ echo "${pkg_name}-wheel-name=$(ls "${pkg_name}"-*.whl)" >> $GITHUB_OUTPUT
390+ done
391+
392+ - name : Build and push client (dev)
393+ uses : docker/build-push-action@v6
394+ with :
395+ context : extensions/containers/client
396+ push : ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
397+ tags : ghcr.io/diracgrid/gubbins/client:dev
398+ platforms : linux/amd64,linux/arm64
399+ - name : Build and push service (dev)
400+ uses : docker/build-push-action@v6
401+ with :
402+ context : extensions/containers/services
403+ push : ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
404+ tags : ghcr.io/diracgrid/gubbins/services:dev
405+ platforms : linux/amd64,linux/arm64
406+ build-args : |
407+ EXTRA_PACKAGES_TO_INSTALL=git+https://github.com/DIRACGrid/DIRAC.git@integration
408+ EXTENSION_CUSTOM_SOURCES_TO_INSTALL=/bindmount/gubbins_db*.whl,/bindmount/gubbins_logic*.whl,/bindmount/gubbins_routers*.whl,/bindmount/gubbins_client*.whl
0 commit comments