Linux64 / Linux armv6/armv7/arm64 - Configure build list #643
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-ios | |
on: | |
push: | |
paths-ignore: | |
- '**/README.md' | |
pull_request: | |
paths-ignore: | |
- '**/README.md' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
TARGET: "ios" | |
NO_FORCE: 1 | |
GA_CI_SECRET: ${{ secrets.CI_SECRET }} | |
USE_ARTIFACT: true | |
jobs: | |
build-for-ios-platform: | |
runs-on: macos-14 | |
strategy: | |
matrix: | |
bundle: [1, 2, 3] | |
env: | |
BUNDLE: ${{ matrix.bundle }} | |
DEVELOPER_DIR: "/Applications/Xcode.app/Contents/Developer" | |
steps: | |
- name: Determine Release | |
id: vars | |
shell: bash | |
run: | | |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then | |
echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV | |
elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then | |
echo "RELEASE=nightly" >> $GITHUB_ENV | |
elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then | |
echo "RELEASE=latest" >> $GITHUB_ENV | |
else | |
echo "RELEASE=latest" >> $GITHUB_ENV | |
fi | |
- uses: actions/checkout@v4 | |
- name: Scripts Calc Formula - ${{ env.TARGET }} Bundle ${{ matrix.bundle }} | |
run: ./scripts/calculate_formulas.sh | |
- name: Scripts Install | |
run: ./scripts/osx/install.sh | |
- name: 'Download artifacts' | |
uses: actions/github-script@v7 | |
if: env.USE_ARTIFACT == 'true' | |
with: | |
script: | | |
const fs = require('fs'); | |
const path = require('path'); | |
const outputDir = path.join(process.env.GITHUB_WORKSPACE, 'out'); | |
// Ensure output directory exists | |
if (!fs.existsSync(outputDir)) { | |
fs.mkdirSync(outputDir); | |
} | |
try { | |
console.log("Fetching artifacts..."); | |
const artifacts = await github.rest.actions.listArtifactsForRepo({ | |
owner: 'openframeworks', | |
repo: 'apothecary', | |
sort: 'created_at', | |
direction: 'desc', | |
per_page: 150 | |
}); | |
const target = process.env.TARGET; | |
const bundle = process.env.MATRIX_BUNDLE; | |
const release = process.env.RELEASE; | |
console.log(`Target: ${target}, Bundle: ${bundle}, Release: ${release}`); | |
const artifactName1 = `libs-${release}-${target}-1`; | |
const artifactName2 = `libs-${release}-${target}-2`; | |
const artifactName3 = `libs-${release}-${target}-3`; | |
const artifactNamesToDownload = new Set([artifactName1, artifactName2, artifactName3]); | |
console.log(`Artifacts to download: ${Array.from(artifactNamesToDownload).join(', ')}`); | |
let count = 0; | |
const max = 3; | |
for (const artifact of artifacts.data.artifacts) { | |
console.log(`Checking artifact: ${artifact.name} (Expired: ${artifact.expired})`); | |
const isArtifactMatch = artifact.name.includes(`libs-${release}-${target}`) && !artifact.expired; | |
if (isArtifactMatch) { | |
const download = await github.rest.actions.downloadArtifact({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
artifact_id: artifact.id, | |
archive_format: 'zip', | |
}); | |
const artifactPath = path.join(outputDir, `${artifact.name}.zip`); | |
fs.writeFileSync(artifactPath, Buffer.from(download.data)); | |
console.log(`Downloaded ${artifact.name} to ${artifactPath}`); | |
count++; | |
if (count >= max) { | |
console.log("Reached maximum artifact download count."); | |
break; | |
} | |
} else { | |
console.log(`Skipping artifact: ${artifact.name} - Conditions not met.`); | |
} | |
} | |
} catch (error) { | |
console.error("An error occurred:", error); | |
} | |
- name: Extract Artifacts to /out | |
if: env.USE_ARTIFACT == 'true' | |
run: | | |
mkdir -p out | |
if ls out/*.zip 1> /dev/null 2>&1; then | |
for zip in out/*.zip; do | |
echo "Extracting $zip..." | |
unzip -o "$zip" -d out/ | |
done | |
echo "Extraction complete." | |
rm out/*.zip | |
else | |
echo "No zip files to extract." | |
fi | |
if ls out/*.tar.bz2 1> /dev/null 2>&1; then | |
for tarball in out/*.tar.bz2; do | |
echo "Extracting $tarball..." | |
tar -xjf "$tarball" -C out/ | |
done | |
echo ".tar.bz2 extraction complete." | |
rm -f out/*.tar.bz2 | |
else | |
echo "No .tar.bz2 files to extract." | |
fi | |
rm -f xout/*.tar.bz2 | |
rm -f out/*.tar.bz2 | |
- name: Build iOS arm64 | |
working-directory: ${{ env.GITHUB_WORKSPACE }} | |
run: scripts/build.sh | |
env: | |
BUNDLE: ${{ matrix.bundle }} | |
ARCH: arm64 | |
- name: Build iOS SIMULATOR x86_64 | |
working-directory: ${{ env.GITHUB_WORKSPACE }} | |
run: scripts/build.sh | |
env: | |
BUNDLE: ${{ matrix.bundle }} | |
ARCH: x86_64 | |
- name: Build iOS SIMULATOR arm64 | |
working-directory: ${{ env.GITHUB_WORKSPACE }} | |
run: scripts/build.sh | |
env: | |
BUNDLE: ${{ matrix.bundle }} | |
ARCH: SIM_arm64 | |
- name: List output directory | |
run: ls -lah out/ | |
- name: Cleanup out of bundle | |
working-directory: ${{ env.GITHUB_WORKSPACE }} | |
run: scripts/artifact/artifact-clean.sh | |
env: | |
BUNDLE: ${{ matrix.bundle }} | |
- name: List output directory2 | |
run: ls -lah out/ | |
- name: Package Binaries for Artifact | |
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/artifact/artifact.sh | |
env: | |
BUNDLE: ${{ matrix.bundle }} | |
- name: Upload binaries as Artifact | |
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding' || contains(github.ref, 'refs/tags/')) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: libs-${{ env.RELEASE }}-${{ env.TARGET }}-${{ matrix.bundle }} | |
path: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}_${{ matrix.bundle }}.tar.bz2 | |
retention-days: 31 | |
- name: Remove .tar.bz2 files | |
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding' || contains(github.ref, 'refs/tags/')) | |
run: | | |
echo "Removing .tar.bz2 files from out/ directory..." | |
rm -f out/*.tar.bz2 | |
rm -f xout/*.tar.bz2 | |
echo "Cleanup complete." | |
- name: Merge our iOS libaries into XC Framework | |
working-directory: ${{ env.GITHUB_WORKSPACE }} | |
run: scripts/ios/xcframework_all.sh | |
env: | |
BUNDLE: ${{ matrix.bundle }} | |
- name: Package | |
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.sh | |
env: | |
BUNDLE: ${{ matrix.bundle }} | |
- name: Update Release arm64 | |
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: softprops/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: ${{ env.RELEASE }} | |
files: xout/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}_${{ matrix.bundle }}.tar.bz2 |