Skip to content

Linux64 / Linux armv6/armv7/arm64 - Configure build list #1398

Linux64 / Linux armv6/armv7/arm64 - Configure build list

Linux64 / Linux armv6/armv7/arm64 - Configure build list #1398

name: build-emscripten
on:
push:
paths-ignore:
- '**/README.md'
pull_request:
paths-ignore:
- '**/README.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
TARGET: "emscripten"
EMSDK_VERSION: "3.1.73"
USE_ARTIFACT: true
jobs:
build-emscripten:
runs-on: ubuntu-latest
strategy:
matrix:
ARCH: [32, 64]
PTHREADS: [0, 1]
steps:
- uses: actions/checkout@v4
- name: Docker Step
run: docker run -di --name emscripten -v $PWD:/src emscripten/emsdk:${{ env.EMSDK_VERSION }} bash
- name: Scripts Calc Formula
run: ./scripts/calculate_formulas.sh
- name: Scripts Install
run: ./scripts/$TARGET/install.sh
- 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
fi
- name: Download previous artifacts
uses: actions/github-script@v7
if: env.USE_ARTIFACT == 'true'
with:
script: |
const fs = require('fs');
const path = require('path');
// Ensure the output directory exists
const outputDir = path.join(process.env.GITHUB_WORKSPACE, 'out');
if (!fs.existsSync(outputDir)){
fs.mkdirSync(outputDir);
}
// List all artifacts for the repository
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 release = process.env.RELEASE;
const arch = process.env.ARCH;
const pthreads = process.env.PTHREADS_ENABLED;
const artifactName = `libs-${release}-${target}-${arch}-${pthreads}`;
let count = 0;
const max = 1;
for (const artifact of artifacts.data.artifacts) {
const isArtifactMatch = artifact.name.includes(`libs-${release}-${target}-${arch}-${pthreads}`) && !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) {
break;
}
}
}
- 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
run: ./scripts/build.sh
env:
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
ARCH: ${{ matrix.ARCH }}
PTHREADS_ENABLED: ${{ matrix.PTHREADS }}
- 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: |
ARCH_SUFFIX=""
if [[ "${{ matrix.ARCH }}" == "64" ]]; then
ARCH_SUFFIX="_memory64"
fi
PTHREADS_SUFFIX=""
if [[ "${{ matrix.PTHREADS }}" == "1" ]]; then
PTHREADS_SUFFIX="_pthreads"
fi
FILENAME="openFrameworksLibs_${{ env.RELEASE }}_emscripten${ARCH_SUFFIX}${PTHREADS_SUFFIX}.tar.bz2"
echo "FILENAME=$FILENAME" >> $GITHUB_ENV
scripts/package.sh
env:
GA_CI_SECRET: ${{ secrets.CI_SECRET }}
ARCH: ${{ matrix.ARCH }}
PTHREADS_ENABLED: ${{ matrix.PTHREADS }}
- name: Upload 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 }}-emscripten-${{ matrix.ARCH }}-${{ matrix.PTHREADS }}
path: out/${{ env.FILENAME }}
retention-days: 31
- name: Update Release emscripten
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: out/${{ env.FILENAME }}