Skip to content

Apple xcframeworks: merge archives built for only one arch (KleidiCV arm64) into the universal archive #2216

Apple xcframeworks: merge archives built for only one arch (KleidiCV arm64) into the universal archive

Apple xcframeworks: merge archives built for only one arch (KleidiCV arm64) into the universal archive #2216

Workflow file for this run

name: build-linux
on:
push:
branches: [bleeding, master]
tags: ['**', '!latest', '!latest-modular', '!nightly', '!build-state', '!sha256', '!nightly-staging-*', '!nightly-previous-*']
paths-ignore:
- "**/README.md"
pull_request:
paths-ignore:
- "**/README.md"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ startsWith(github.ref, 'refs/tags/') && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
permissions:
contents: write
actions: read
env:
# Bump for compiler/SDK setup or build-command changes not declared below.
BUILD_PROFILE_ID: "1"
jobs:
pre-check:
runs-on: ubuntu-latest
outputs:
workflow_disabled: ${{ steps.plan.outputs.workflow_disabled }}
build_needed: ${{ steps.plan.outputs.build_needed }}
matrix: ${{ steps.plan.outputs.matrix }}
steps:
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
- name: Plan selected formula and toolchain builds
id: plan
uses: actions/github-script@v9.0.0
with:
script: |
await require(`${process.env.GITHUB_WORKSPACE}/scripts/release-build-plan.cjs`).plan({github, context, core, workflow: '.github/workflows/build-linux64.yml', job: 'build'});
- uses: actions/upload-artifact@v7.0.2
with:
name: build-plan-${{ github.workflow }}
path: .build-plans/*.pkl
include-hidden-files: true
if-no-files-found: ignore
build:
needs: pre-check
if: needs.pre-check.outputs.build_needed == 'true'
name: Linux - ${{ matrix.arch }} - GCC10
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.pre-check.outputs.matrix) }}
runs-on: ${{ matrix.runner }}
container: ubuntu:20.04
env:
TARGET: linux
TYPE: linux
ARCH: ${{ matrix.arch }}
GCC: gcc10
LINUX_ARTIFACT_TARGET: ${{ matrix.artifact_target }}
NO_FORCE: 1
USE_ARTIFACT: true
CC: gcc-10
CXX: g++-10
CFLAGS: -O2 -fPIC ${{ matrix.arch_flags }}
CXXFLAGS: -O2 -fPIC -D_GLIBCXX_USE_CXX11_ABI=1 ${{ matrix.arch_flags }}
steps:
- name: Restore APT package cache
uses: actions/cache@v6.1.0
with:
path: /github/home/.cache/apt/archives
key: apt-focal-${{ matrix.arch }}-gcc10-v1
- name: Install build tools and GCC 10
shell: bash
env:
APT_ARCHIVES: /github/home/.cache/apt/archives
run: |
set -euo pipefail
retry() {
local attempt=1
local max_attempts=3
until "$@"; do
if (( attempt >= max_attempts )); then
echo "Command failed after ${attempt} attempts: $*" >&2
return 1
fi
echo "Attempt ${attempt} failed; retrying in $((attempt * 5)) seconds: $*" >&2
sleep $((attempt * 5))
attempt=$((attempt + 1))
done
}
install -d -m 755 "$APT_ARCHIVES/partial"
retry apt-get update
retry env DEBIAN_FRONTEND=noninteractive apt-get \
-o "Dir::Cache::archives=$APT_ARCHIVES" \
-o Acquire::Retries=5 \
install -y ca-certificates git sudo gcc-10 g++-10 gfortran-10 binutils file curl unzip bzip2 autoconf automake build-essential ccache coreutils dos2unix flex gperf libtool make ninja-build pkg-config python3 python3-pip xz-utils freeglut3-dev libasound2-dev libc6-dev libegl1-mesa-dev libfftw3-dev libgl1-mesa-dev libglu1-mesa-dev libjack-dev libpulse-dev libwayland-dev libx11-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxkbcommon-dev libxrandr-dev oss4-dev xorg-dev
python3 -m pip install --no-cache-dir cmake==3.31.6
cmake --version
gcc-10 --version
test "$(gcc-10 -dumpversion | cut -d. -f1)" = 10
- uses: actions/checkout@v7.0.1
- name: Trust checked-out workspace
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Determine release identity
shell: bash
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
release="$GITHUB_REF_NAME"
elif [[ "$GITHUB_REF" == refs/heads/master ]]; then
release=nightly
else
release=latest
fi
echo "RELEASE=$release" >> "$GITHUB_ENV"
- name: Build libraries
run: scripts/build.sh
- name: Package canonical archive
run: scripts/package.sh
- name: List output directory
run: ls -lah out/
- name: List output main directory
run: ls -lah
- name: List packaged file
run: find out/ -type f \( -name "*.zip" -o -name "*.tar.bz2" \) -exec echo {} \;
- name: Generate Summary
run: |
chmod +x ./scripts/summary.sh
./scripts/summary.sh
- name: Update Release
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding')
uses: danoli3/action-gh-release@ec40b04e78c39008f73c4ca3fdf9b51df604c4ed # temporary patch: softprops/action-gh-release#852
with:
token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
tag_name: ${{ env.RELEASE }}
draft: false
files: |
out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}_${{ env.ARCH }}_${{ env.GCC }}.tar.bz2
out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}_${{ env.ARCH }}_${{ env.GCC }}.tar.bz2.manifest.json
# The separate publisher covers latest/latest-modular. Retain existing
# sidecar publication for nightly and immutable versioned releases.
- name: Publish checksum for other release channels
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && env.RELEASE != 'latest' && env.RELEASE != 'latest-modular' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding')
uses: danoli3/action-gh-release@ec40b04e78c39008f73c4ca3fdf9b51df604c4ed # temporary patch: softprops/action-gh-release#852
with:
token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
tag_name: ${{ env.RELEASE }}
files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}_${{ env.ARCH }}_${{ env.GCC }}.tar.bz2.sha256
- name: Download verified Linux build plan
if: github.event_name == 'push' && (github.ref == 'refs/heads/bleeding' || github.ref == 'refs/heads/master')
uses: actions/download-artifact@v8.0.2
with:
name: build-plan-${{ github.workflow }}
path: ${{ runner.temp }}/build-plans
- name: Record final release outputs
if: github.event_name == 'push' && (github.ref == 'refs/heads/bleeding' || github.ref == 'refs/heads/master')
uses: actions/github-script@v9.0.0
env:
BUILD_PLAN_MATRIX: ${{ toJSON(matrix) }}
with:
github-token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
script: |
await require(`${process.env.GITHUB_WORKSPACE}/scripts/release-build-plan.cjs`).record({github, context, core, workflow: '.github/workflows/build-linux64.yml', job: 'build', matrix: JSON.parse(process.env.BUILD_PLAN_MATRIX)});
- name: Clean
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push'
run: |
rm -f out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}_${{ env.ARCH }}_${{ env.GCC }}.tar.bz2
- name: Package Split
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding' || contains(github.ref, 'refs/tags/'))
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: scripts/package-individual.sh
env:
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
ARCH: ${{ env.ARCH }}
- name: List output directory 3
run: ls -lah out/
- name: Clean before latest-modular upload
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') && env.GCC == 'gcc10'
run: |
echo "Cleaning any existing openFrameworksLibs* files before latest-modular upload..."
rm -f out/openFrameworksLibs*.tar.bz2
- name: Upload to GitHub Release
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') && env.GCC == 'gcc10'
uses: danoli3/action-gh-release@ec40b04e78c39008f73c4ca3fdf9b51df604c4ed # temporary patch: softprops/action-gh-release#852
with:
token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
tag_name: "latest-modular"
files: out/*.tar.bz2