Skip to content
# This workflow will build and install WMCore core services locally within
# virtual environment
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: |
echo "create new requirements.txt without gfal dependencies for CI/CD"
cat requirements.txt | egrep -v "gfal" > requirements.${{ matrix.target }}.txt
awk "/(${{ matrix.target }}$)|(${{ matrix.target }},)/ {print \$1}" requirements.${{ matrix.target }}.txt > requirements.txt
- name: Build sdist and wheels
run: python3 setup.py clean sdist bdist_wheel
- name: Verify built package
run: ls -lh dist/
- name: Install package locally from built artifacts
run: |
pip install -r requirements.txt
pip install --no-index --find-links=dist/ ${{ matrix.target }}
- name: Test package installation
run: |
pip list --format=freeze | grep ${{ matrix.target }}