add macos ci build

This commit is contained in:
Agel committed 2026-11-12 14:02:50 +01:00
1 parent cdd33bc60e
commit ff8ef105dd
5 files changed
+193 -9

No files matched your search

+80 -2
View File
@@ -125,12 +125,38 @@ build-windows-arm64:
when: never
- when: on_success
# ── macOS native build ─────────────────────────────────────────────────────────
build-macos:
interruptible: true
allow_failure: true
timeout: 10m
tags:
- macos-qt
stage: build
script:
- export PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}"
- export PKG_CONFIG_PATH="$(brew --prefix libarchive)/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
- cmake -B build-macos -G Ninja -DCMAKE_BUILD_TYPE=Release
-DCMAKE_PREFIX_PATH="${QT_MACOS_DIR:-/opt/qt/6.10.3/macos}"
- cmake --build build-macos --target asteria-qt
artifacts:
name: "asteria-qt-macos-${CI_COMMIT_SHORT_SHA}"
paths:
- build-macos/asteria-qt.app
expire_in: 1 day
when: on_success
rules:
- if: $CI_PIPELINE_TYPE == "image-rebuild"
when: never
- when: on_success
# ── Linux tests ────────────────────────────────────────────────────────────────
test-linux:
interruptible: true
tags:
- linux-qt
stage: test
needs: []
script:
- cmake -B build-linux -G Ninja -DCMAKE_BUILD_TYPE=Release
-DCMAKE_PREFIX_PATH="${QT_LINUX_DIR}"
@@ -141,6 +167,27 @@ test-linux:
when: never
- when: on_success
# ── macOS tests ────────────────────────────────────────────────────────────────
test-macos:
interruptible: true
allow_failure: true
timeout: 10m
tags:
- macos-qt
stage: test
needs: []
script:
- export PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}"
- export PKG_CONFIG_PATH="$(brew --prefix libarchive)/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
- cmake -B build-macos -G Ninja -DCMAKE_BUILD_TYPE=Release
-DCMAKE_PREFIX_PATH="${QT_MACOS_DIR:-/opt/qt/6.10.3/macos}"
- cmake --build build-macos
- QT_QPA_PLATFORM=offscreen ctest --test-dir build-macos --output-on-failure
rules:
- if: $CI_PIPELINE_TYPE == "image-rebuild"
when: never
- when: on_success
# ── Package Linux as AppImage ─────────────────────────────────────────────
package-linux:
interruptible: true
@@ -208,6 +255,34 @@ package-windows-arm64:
when: never
- when: on_success
# ── Package macOS as DMG ──────────────────────────────────────────────────────
package-macos:
interruptible: true
allow_failure: true
timeout: 10m
tags:
- macos-qt
stage: package
needs:
- build-macos
- test-macos
variables:
CODESIGN: "false"
script:
- export PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}"
- chmod +x packaging/package-macos.sh
- packaging/package-macos.sh build-macos "${QT_MACOS_DIR:-/opt/qt/6.10.3/macos}" dist
artifacts:
name: "asteria-qt-macos-dmg-${CI_COMMIT_SHORT_SHA}"
paths:
- dist/Asteria.dmg
expire_in: 1 day
when: on_success
rules:
- if: $CI_PIPELINE_TYPE == "image-rebuild"
when: never
- when: on_success
# ── Update wiki with latest dev build links ────────────────────────────────────
update-wiki:
stage: wiki
@@ -217,6 +292,8 @@ update-wiki:
- package-linux
- package-windows
- package-windows-arm64
- job: package-macos
optional: true
script:
- |
if [ -z "${GITLAB_TOKEN}" ]; then
@@ -230,14 +307,15 @@ update-wiki:
- LINUX_URL="${ARTIFACTS_URL}?job=package-linux"
- WINDOWS_URL="${ARTIFACTS_URL}?job=package-windows"
- WINDOWS_ARM64_URL="${ARTIFACTS_URL}?job=package-windows-arm64"
- MACOS_URL="${ARTIFACTS_URL}?job=package-macos"
- |
HTTP_CODE=$(curl -s -o /tmp/wiki.json -w '%{http_code}' \
--header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" \
"${WIKI_URL}")
NEW_SECTION=$(printf '## Latest dev builds\n\n> Updated automatically by pipeline [#%s](%s) from `%s` @ %s\n\n| Platform | Download |\n|----------|----------|\n| Linux (x86_64) | [AppImage](%s) |\n| Windows (x86_64) | [Portable zip](%s) |\n| Windows (ARM64) | [Portable zip](%s) |' \
NEW_SECTION=$(printf '## Latest dev builds\n\n> Updated automatically by pipeline [#%s](%s) from `%s` @ %s\n\n| Platform | Download |\n|----------|----------|\n| Linux (x86_64) | [AppImage](%s) |\n| Windows (x86_64) | [Portable zip](%s) |\n| Windows (ARM64) | [Portable zip](%s) |\n| macOS | [DMG](%s) |' \
"${CI_PIPELINE_ID}" "${CI_PIPELINE_URL}" "${CI_COMMIT_REF_NAME}" "${CI_COMMIT_SHORT_SHA}" \
"${LINUX_URL}" "${WINDOWS_URL}" "${WINDOWS_ARM64_URL}")
"${LINUX_URL}" "${WINDOWS_URL}" "${WINDOWS_ARM64_URL}" "${MACOS_URL}")
if [ "${HTTP_CODE}" = "200" ]; then
WIKI_CONTENT=$(jq -r '.content' /tmp/wiki.json)