Skip to content

build

build #343

Workflow file for this run

name: build
on:
push:
paths:
- 'recipes/**'
schedule:
# Executed daily, 9:37 is randomly picked time, not 00:00,
# because 00:00 is used too frequently and GitHub asks to do cronjobs at less busy times
- cron: '37 9 * * *'
workflow_dispatch:
inputs:
package_name:
description: Package name
type: choice
options:
- all
- odrcore
- pdf2htmlex
- fontforge
- poppler
- poppler-data
- cairo
- openlibm
- fontconfig
- glib
- tmpfile
- libgsf
- libwmf
- wvware
package_version:
description: Package version. Specify 'newest' or leave empty to request the newest version. Specify 'all' to request all versions.
required: false
upload_to_artifactory:
description: Upload built packages to artifactory
type: boolean
default: false
build_dependents:
description: Parse conan dependency tree and build not just the requested package, but also all dependents of it
type: boolean
default: true
build_dependencies_from_source:
description: Build all dependencies from source (conan install --build=* instead of --build=missing)
type: boolean
default: false
run-name: build ${{ inputs.package_name }}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
generate-matrices:
runs-on: ubuntu-22.04
outputs:
packages_0: ${{ steps.list-packages-with-dependents.outputs.packages_0 }}
packages_1: ${{ steps.list-packages-with-dependents.outputs.packages_1 }}
packages_2: ${{ steps.list-packages-with-dependents.outputs.packages_2 }}
packages_3: ${{ steps.list-packages-with-dependents.outputs.packages_3 }}
packages_4: ${{ steps.list-packages-with-dependents.outputs.packages_4 }}
steps:
- name: checkout
uses: actions/checkout@v4
with:
# Fetch whole git history.
# Required to parse modified packages
fetch-depth: 0
- name: setup python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: install python dependencies
run: pip install --upgrade pip conan
- name: conan config
run: conan config install .github/config/ubuntu-22.04/conan
- name: Conan export all packages
run: python scripts/conan_export_all_packages.py
# Generate dependency graphs for all disjoint packages
# Dependency graphs for android-21 and android-23 profiles are not identical.
# android-21 has an extra openlibm dependency. Android ABI does not matter for dependency graph, as long as it's still Android.
# Generating graphs for both 21 and 23 would be more self-explanatory, but conan graph generation takes a few seconds.
- name: Generate odrcore dependency tree
id: odrcore-dependency-tree
if: ${{ github.event.inputs.build_dependents != 'false' }}
shell: bash # bash shell needed to pipefail on error
run: |
conan graph info recipes/odrcore/all/conanfile.py --version=4.1.0-pdf2htmlex-git --profile:host=android-21-armv8 --format=json | tee odrcore-dependency-tree.json
echo "graph_file=odrcore-dependency-tree.json" >> $GITHUB_OUTPUT
- name: Generate wvware dependency tree
id: wvware-dependency-tree
if: ${{ github.event.inputs.build_dependents != 'false' }}
shell: bash # bash shell needed to pipefail on error
run: |
conan graph info recipes/wvware/all/conanfile.py --version=1.2.9 --profile:host=android-21-armv8 --format=json | tee wvware-dependency-tree.json
echo "graph_file=wvware-dependency-tree.json" >> $GITHUB_OUTPUT
- name: Get requested packages and dependants from commits and workflow_dispatch inputs
id: list-packages-with-dependents
run: python scripts/list_package_versions.py --dependency-graph ${{ steps.odrcore-dependency-tree.outputs.graph_file }} ${{ steps.wvware-dependency-tree.outputs.graph_file }}
env:
GITHUB_EVENT: ${{ toJson(github.event) }}
build_0:
if: ${{ needs.generate-matrices.outputs.packages_0 != '[]' && needs.generate-matrices.outputs.packages_0 != '' }}
name: ${{ matrix.package.package_reference }}
needs:
- generate-matrices
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.generate-matrices.outputs.packages_0) }}
uses: ./.github/workflows/build_inner.yml
with:
conanfile: ${{ matrix.package.conanfile }}
package_version: ${{ matrix.package.version }}
build_dependencies_from_source: ${{ github.event.inputs.build_dependencies_from_source == 'true' }}
artifactory_upload: ${{ github.repository_owner == 'opendocument-app' && (github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_artifactory == 'true')) }}
secrets:
ARTIFACTORY: ${{ secrets.ARTIFACTORY }}
build_1:
if: ${{ needs.generate-matrices.outputs.packages_1 != '[]' && needs.generate-matrices.outputs.packages_1 != '' }}
name: ${{ matrix.package.package_reference }}
needs:
- generate-matrices
- build_0
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.generate-matrices.outputs.packages_1) }}
uses: ./.github/workflows/build_inner.yml
with:
conanfile: ${{ matrix.package.conanfile }}
package_version: ${{ matrix.package.version }}
build_dependencies_from_source: ${{ github.event.inputs.build_dependencies_from_source == 'true' }}
artifactory_upload: ${{ github.repository_owner == 'opendocument-app' && (github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_artifactory == 'true')) }}
secrets:
ARTIFACTORY: ${{ secrets.ARTIFACTORY }}
build_2:
if: ${{ needs.generate-matrices.outputs.packages_2 != '[]' && needs.generate-matrices.outputs.packages_2 != '' }}
name: ${{ matrix.package.package_reference }}
needs:
- generate-matrices
- build_1
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.generate-matrices.outputs.packages_2) }}
uses: ./.github/workflows/build_inner.yml
with:
conanfile: ${{ matrix.package.conanfile }}
package_version: ${{ matrix.package.version }}
build_dependencies_from_source: ${{ github.event.inputs.build_dependencies_from_source == 'true' }}
artifactory_upload: ${{ github.repository_owner == 'opendocument-app' && (github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_artifactory == 'true')) }}
secrets:
ARTIFACTORY: ${{ secrets.ARTIFACTORY }}
build_3:
if: ${{ needs.generate-matrices.outputs.packages_3 != '[]' && needs.generate-matrices.outputs.packages_3 != '' }}
name: ${{ matrix.package.package_reference }}
needs:
- generate-matrices
- build_2
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.generate-matrices.outputs.packages_3) }}
uses: ./.github/workflows/build_inner.yml
with:
conanfile: ${{ matrix.package.conanfile }}
package_version: ${{ matrix.package.version }}
build_dependencies_from_source: ${{ github.event.inputs.build_dependencies_from_source == 'true' }}
artifactory_upload: ${{ github.repository_owner == 'opendocument-app' && (github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_artifactory == 'true')) }}
secrets:
ARTIFACTORY: ${{ secrets.ARTIFACTORY }}
build_4:
if: ${{ needs.generate-matrices.outputs.packages_4 != '[]' && needs.generate-matrices.outputs.packages_4 != '' }}
name: ${{ matrix.package.package_reference }}
needs:
- generate-matrices
- build_3
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.generate-matrices.outputs.packages_4) }}
uses: ./.github/workflows/build_inner.yml
with:
conanfile: ${{ matrix.package.conanfile }}
package_version: ${{ matrix.package.version }}
build_dependencies_from_source: ${{ github.event.inputs.build_dependencies_from_source == 'true' }}
artifactory_upload: ${{ github.repository_owner == 'opendocument-app' && (github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_artifactory == 'true')) }}
secrets:
ARTIFACTORY: ${{ secrets.ARTIFACTORY }}