ci: Build wheels for plugins #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
env: | |
PYTHON_VERSION: '3.12' | |
TZ: Europe/Zurich | |
on: | |
push: | |
branches: | |
- 'master' | |
- '*.x' | |
- 'ci-build-plugins' # TODO remove | |
pull_request: | |
branches: | |
- 'master' | |
- '*.x' | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- labeled | |
jobs: | |
list-plugins: | |
name: Get plugin list π | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'build-wheel') | |
outputs: | |
PLUGINS_MATRIX: ${{ steps.list-plugins.outputs.PLUGINS_MATRIX }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python π | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Generate matrix | |
id: list-plugins | |
run: python .github/utils/generate_matrix.py | |
build: | |
name: Build package for ${{ matrix.plugin }} π¦ | |
needs: list-plugins | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'build-wheel') | |
strategy: | |
matrix: ${{ fromJson(needs.list-plugins.outputs.PLUGINS_MATRIX) }} | |
steps: | |
- name: Checkout plugins | |
uses: actions/checkout@v4 | |
with: | |
path: plugins | |
# prefer head commit over merge commit in case of PRs | |
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }} | |
- name: Pick Indico core repo | |
id: core-repo | |
env: | |
GH_TOKEN: ${{ github.token }} | |
PR_BODY: ${{ github.event_name == 'pull_request' && github.event.pull_request.body }} | |
PR_BASE_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref }} | |
run: python plugins/.github/utils/get_core_repo.py indico/indico INDICO | |
- name: Checkout core | |
uses: actions/checkout@v4 | |
with: | |
path: indico | |
repository: indico/indico | |
ref: ${{ steps.core-repo.outputs.INDICO_BRANCH }} | |
- name: Set up Python π | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
cache: pip | |
cache-dependency-path: | | |
indico/requirements*.txt | |
plugins/**/setup.cfg | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: Install build deps π§ | |
working-directory: indico | |
run: | | |
sudo apt-get install libpq-dev | |
pip install --user -U pip setuptools wheel | |
pip install --user -e '.[dev]' | |
- name: Build wheel | |
working-directory: indico | |
run: | | |
./bin/maintenance/build-wheel.py plugin ../plugins/${{ matrix.plugin }} --add-version-suffix | |
# - name: Install npm deps β | |
# run: npm ci | |
# - name: Build wheel π | |
# run: ./bin/maintenance/build-wheel.py indico --add-version-suffix | |
# - uses: actions/upload-artifact@v4 | |
# name: Upload build artifacts π¦ | |
# with: | |
# name: indico-wheel | |
# retention-days: 7 | |
# path: ./dist |