Skip to content
# This workflow will build and upload WMCore core services to the production PyPI
# based on tag releases, see build_and_publish_services job. Then, the second
# named build_images, will build appropriate docker images using CMSKubernetes
# Dockefiles and upload them to CERN registry.
#
# The build_and_publish_services job relies on pypi_build_template.yaml
# The build_images relies on docker_images_template.yaml template
# Each job use matrics target (as input list to iterate) and setup
# wmcore_component which is used by corresponding template to perform
# set of actions. We also define here necessary secrets used by given template.
on:
# this section fires workflow on a specific tag which matches some pattern
push:
tags:
- '*.*.*'
# this section forces manual builds
workflow_dispatch:
inputs:
name:
description: 'WMCore services'
jobs:
# first job performs build and upload of packages to PyPI
build_and_publish_services:
name: Build_and_upload_to_pypi
runs-on: ubuntu-latest
environment:
name: production
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
strategy:
matrix:
target: [wmagent, wmagent-devtools, wmcore, reqmon, reqmgr2, global-workqueue, acdcserver, reqmgr2ms-unmerged,
reqmgr2ms-output, reqmgr2ms-pileup, reqmgr2ms-rulecleaner, reqmgr2ms-transferor, reqmgr2ms-monitor]
steps:
- uses: actions/checkout@v4
- name: Setup python 3.8
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Upgrade pip3
run: |
python3 -m pip install --upgrade pip
- name: Update the setup script template with package name
run: |
sed "s/PACKAGE_TO_BUILD/${{ matrix.target }}/" setup_template.py > setup.py
- name: Create requirements file
run: |
cp requirements.txt requirements.wmcore.txt
awk "/(${{ matrix.target }}$)|(${{ matrix.target }},)/ {print \$1}" requirements.wmcore.txt > requirements.txt
- name: Build sdist
run: python3 setup.py clean sdist
- name: Upload package distribution to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
# second job, depends on build_and_publish_services, builds and upload
# docker images to CERN registry
build_images:
name: Build_images
needs: [build_and_publish_services]
strategy:
matrix:
target: [wmagent, reqmon, t0_reqmon, reqmgr2, reqmgr2ms-unmerged, global-workqueue,
reqmgr2ms-output, reqmgr2ms-pileup, reqmgr2ms-rulecleaner, reqmgr2ms-transferor, reqmgr2ms-monitor]
uses: ./.github/workflows/docker_images_template.yaml
with:
wmcore_component: ${{ matrix.target }}
secrets:
cern_user: ${{ secrets.CERN_LOGIN }}
cern_token: ${{ secrets.CERN_TOKEN }}