From 134e46968fd204a945cef37b1200d6954788005c Mon Sep 17 00:00:00 2001 From: Kenyi Hurtado Date: Wed, 5 Oct 2022 09:08:15 -0400 Subject: [PATCH] Build WMCore services and publish them to pypy, using to tag pushes --- .github/workflows/pypy_build_publish.yaml | 18 ++++++++++ .../pypy_build_publish_template.yaml | 35 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/pypy_build_publish.yaml create mode 100644 .github/workflows/pypy_build_publish_template.yaml diff --git a/.github/workflows/pypy_build_publish.yaml b/.github/workflows/pypy_build_publish.yaml new file mode 100644 index 00000000000..61855f99f93 --- /dev/null +++ b/.github/workflows/pypy_build_publish.yaml @@ -0,0 +1,18 @@ +# This workflow will build and upload WMCore core services to the production PYPY +# based on tag releases + +on: + push: + tags: + - v2.1.** + +jobs: + build_and_publish_services: + stragegy: + matrix: + target: [wmagent, wmagent-devtools, wmcore, reqmon, reqmgr2, reqmgr2ms, global-workqueue, acdcserver] + uses: ./.github/workflows/pypy_build_publish_template.yaml + with: + target: ${{ matrix.target }} + secrets: + token: ${{ secrets.PYPY_PRODUCTION }} diff --git a/.github/workflows/pypy_build_publish_template.yaml b/.github/workflows/pypy_build_publish_template.yaml new file mode 100644 index 00000000000..804a736568d --- /dev/null +++ b/.github/workflows/pypy_build_publish_template.yaml @@ -0,0 +1,35 @@ +# Reusable workflow to setup a specific WMCore component for pip + +on: + workflow_call: + inputs: + wmcore_component: + required: true + type: string + secrets: + pypy_token: + required: true + +jobs: + build_and_publish_from_template: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup python 3.8 + uses: actions/setup-python@v3 + 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/${{ inputs.wmcore_component }}/" setup_template.py > setup.py + - name: Create requirements file + run: | + awk "/(${{ inputs.wmcore_component }}$)|(${{ inputs.wmcore_component }},)/ {print \$1}" requirements.wmcore.txt > requirements.txt + - name: Build and publish component + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.pypy_token }}