Skip to content

Commit db5d1f4

Browse files
authored
ci(release): all tested arch×linkage artifacts, backends-consistent naming
build_release now mirrors build_test: Linux (x86_64, aarch64), Windows (x86_64, arm64), macOS (x86_64, arm64, universal), each shared AND static — so the published artifacts equal the validated set. Artifact names follow anira-project/backends: anira-<ver>-<OS>-<arch>-<linkage>.zip (Linux=aarch64, Win/mac=arm64, +macOS-universal); the Android bundle is renamed anira-<ver>-Android-static.zip (it ships static per-ABI find_package trees). Static auto-disables LibTorch (shared-only upstream), so a -static desktop zip carries ONNX Runtime + LiteRT. install action: package by runner OS (not hardcoded x86_64 names) so every leg zips, and skip macOS codesign when the build produced no .dylib (static).
1 parent c5bb2ef commit db5d1f4

2 files changed

Lines changed: 40 additions & 24 deletions

File tree

.github/actions/install/action.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,28 +69,33 @@ runs:
6969
p12-file-base64: ${{ inputs.DEV_ID_APP_CERT }}
7070
p12-password: ${{ inputs.DEV_ID_APP_PWD }}
7171

72-
# Codesigning all the libraries
72+
# Codesigning the shared libraries. A static build ships no .dylib (anira is a .a),
73+
# so glob with nullglob and skip when there is nothing to sign.
7374
- name: codesign (macOS)
7475
shell: bash
75-
if: ${{ matrix.os == 'macOS-latest' }}
76+
if: ${{ startsWith(matrix.os, 'macOS') }}
7677
run: |
77-
# codesign all libs
78-
codesign --force -s "${{ inputs.DEV_ID_APP }}" -v ${{ steps.declare_artefact_variables.outputs.PACKAGE_DIR }}/lib/*.dylib --deep --strict --options=runtime --timestamp;
79-
80-
# Zip the artefact
78+
shopt -s nullglob
79+
dylibs=(${{ steps.declare_artefact_variables.outputs.PACKAGE_DIR }}/lib/*.dylib)
80+
if [ ${#dylibs[@]} -gt 0 ]; then
81+
codesign --force -s "${{ inputs.DEV_ID_APP }}" -v "${dylibs[@]}" --deep --strict --options=runtime --timestamp
82+
else
83+
echo "static build — no .dylib to codesign"
84+
fi
85+
86+
# Zip the artefact (keyed on the runner OS, so every arch/linkage leg packages).
8187
- name: zip artefacts
8288
working-directory: ${{github.workspace}}/artefacts
8389
shell: bash
8490
run: |
85-
if [ "${{ matrix.name }}" == "Linux-x86_64" ]; then
86-
zip -r ${{ steps.declare_artefact_variables.outputs.PRODUCT_NAME }}.zip ${{ steps.declare_artefact_variables.outputs.PRODUCT_NAME }}/
87-
elif [ "${{ matrix.os }}" == "macOS-latest" ]; then
88-
zip -vr ${{ steps.declare_artefact_variables.outputs.PRODUCT_NAME }}.zip ${{ steps.declare_artefact_variables.outputs.PRODUCT_NAME }}/ -x "*.DS_Store"
89-
elif [ "${{ matrix.name }}" == "Windows-x86_64" ]; then
90-
pwsh -command "Compress-Archive -Path '${{ steps.declare_artefact_variables.outputs.PRODUCT_NAME }}/' -DestinationPath '${{ steps.declare_artefact_variables.outputs.PRODUCT_NAME }}.zip'"
91+
P="${{ steps.declare_artefact_variables.outputs.PRODUCT_NAME }}"
92+
if [[ "${{ matrix.os }}" == windows* ]]; then
93+
pwsh -command "Compress-Archive -Path '$P/' -DestinationPath '$P.zip'"
94+
elif [[ "${{ matrix.os }}" == macOS* ]]; then
95+
zip -vr "$P.zip" "$P/" -x "*.DS_Store"
9196
else
92-
echo "Unknown OS";
93-
fi;
97+
zip -r "$P.zip" "$P/"
98+
fi
9499
95100
- name: upload artifact
96101
uses: actions/upload-artifact@v4

.github/workflows/on_tag.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,26 @@ jobs:
2424
strategy:
2525
fail-fast: false # show all errors for each platform (vs. cancel jobs on error)
2626
matrix:
27+
# Every desktop platform/arch, both shared and static — mirroring what
28+
# build_test validates, so the published artifacts == the tested set. Arch
29+
# tokens match the anira-project/backends naming (Linux=aarch64, Win/mac=arm64,
30+
# plus macOS-universal). Static auto-disables LibTorch (shared-only upstream),
31+
# so a *-static zip ships ONNX Runtime + LiteRT only.
2732
include:
28-
- name: Linux-x86_64
29-
os: ubuntu-latest
30-
- name: macOS-x86_64
31-
os: macOS-latest
32-
- name: macOS-arm64
33-
os: macOS-latest
34-
- name: Windows-x86_64
35-
os: windows-latest
33+
- { name: Linux-x86_64-shared, os: ubuntu-latest, shared: ON }
34+
- { name: Linux-x86_64-static, os: ubuntu-latest, shared: OFF }
35+
- { name: Linux-aarch64-shared, os: ubuntu-24.04-arm, shared: ON }
36+
- { name: Linux-aarch64-static, os: ubuntu-24.04-arm, shared: OFF }
37+
- { name: Windows-x86_64-shared, os: windows-latest, shared: ON }
38+
- { name: Windows-x86_64-static, os: windows-latest, shared: OFF }
39+
- { name: Windows-arm64-shared, os: windows-11-arm, shared: ON }
40+
- { name: Windows-arm64-static, os: windows-11-arm, shared: OFF }
41+
- { name: macOS-x86_64-shared, os: macOS-latest, shared: ON }
42+
- { name: macOS-x86_64-static, os: macOS-latest, shared: OFF }
43+
- { name: macOS-arm64-shared, os: macOS-latest, shared: ON }
44+
- { name: macOS-arm64-static, os: macOS-latest, shared: OFF }
45+
- { name: macOS-universal-shared, os: macOS-latest, shared: ON }
46+
- { name: macOS-universal-static, os: macOS-latest, shared: OFF }
3647
runs-on: ${{ matrix.os }}
3748
steps:
3849
- name: get repo and submodules
@@ -47,7 +58,7 @@ jobs:
4758
with:
4859
BUILD_TYPE: Release
4960
CMAKE_BUILD_PARALLEL_LEVEL: 4
50-
CMAKE_BUILD_ARGS: "-DBUILD_SHARED_LIBS=ON -DANIRA_WITH_INSTALL=ON"
61+
CMAKE_BUILD_ARGS: "-DBUILD_SHARED_LIBS=${{ matrix.shared }} -DANIRA_WITH_INSTALL=ON"
5162
- name: install
5263
id: install
5364
uses: ./.github/actions/install
@@ -135,7 +146,7 @@ jobs:
135146
run: |
136147
VERSION="$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//')"
137148
[ -z "$VERSION" ] && VERSION="0.0.0"
138-
PRODUCT="anira-${VERSION}-Android"
149+
PRODUCT="anira-${VERSION}-Android-static" # static find_package trees per ABI
139150
for ABI in arm64-v8a x86_64; do
140151
cmake -B "build-${ABI}" -G Ninja \
141152
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake \

0 commit comments

Comments
 (0)