hate-no-d/.forgejo/workflows/apple.yml
pedro-bento 0954f5cbfc
Some checks failed
release / linux/aarch64 (pull_request) Failing after 37s
release / linux/armv7 (pull_request) Failing after 15s
release / linux/i686 (pull_request) Failing after 13s
release / linux/x86_64 (pull_request) Failing after 13s
release / android (pull_request) Successful in 1m53s
release / freebsd/x86_64 (pull_request) Failing after 47s
release / windows/i686 (pull_request) Successful in 1m4s
release / windows/x86_64 (pull_request) Successful in 3m29s
Fix pipeline
2026-10-21 21:14:05 +01:00

96 lines
3.3 KiB
YAML

# Apple targets (macOS + iOS), kept out of the main release pipeline.
#
# Why a separate file: Forgejo Runner is Linux-only, so these jobs need a
# self-hosted runner carrying the `macos` label. Gating them inside
# release.yml with `if: vars.ENABLE_MACOS == 'true'` did not work -- Forgejo
# does not evaluate the `vars` context there, so the jobs were queued forever
# on a label that does not exist and the whole run never finished.
#
# This workflow only exists when dispatched by hand, so it costs nothing until
# a Mac runner is registered.
name: apple
on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag to attach artifacts to (empty = build only)'
required: false
default: ''
env:
FORGEJO_API_URL: ${{ github.server_url }}/api/v1
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
TAG: ${{ github.event.inputs.tag }}
jobs:
# ---------------------------------------------------------------------------
# macOS. Apple SDKs are universal, so either runner arch can cross-build the
# other; only the target objects get -arch, the build tools stay native.
# ---------------------------------------------------------------------------
macos:
name: macos/${{ matrix.arch }}
runs-on: macos
strategy:
fail-fast: false
matrix:
arch: [arm64, x86_64]
steps:
- name: Checkout
uses: https://data.forgejo.org/actions/checkout@v4
with:
submodules: false
# luajit.org serves git over dumb HTTP, which rejects shallow clones.
# checkout's submodule support always passes --depth, which fails with
# "dumb http transport does not support shallow capabilities", so the
# submodule is cloned in full here instead.
- name: Fetch submodules
run: git submodule update --init --recursive
- name: Build
run: |
make \
CFLAGS="-O2 -Wall -arch ${{ matrix.arch }}" \
LUAJIT_EXTRA="TARGET_FLAGS=-arch ${{ matrix.arch }}" \
all
- name: Verify architecture
run: |
set -eu
file ./hate-no-d
file ./hate-no-d | grep -q '${{ matrix.arch }}'
- name: Attach to release
if: github.event.inputs.tag != ''
run: sh .forgejo/scripts/release-asset.sh ./hate-no-d "hate-no-d-macos-${{ matrix.arch }}"
# ---------------------------------------------------------------------------
# iOS. Deliberately produces no executable: the JIT is compiled out and the
# archive is linked into an Xcode app target. Requires jq for the upload.
# ---------------------------------------------------------------------------
ios:
name: ios/arm64
runs-on: macos
steps:
- name: Checkout
uses: https://data.forgejo.org/actions/checkout@v4
with:
submodules: false
- name: Fetch submodules
run: git submodule update --init --recursive
- name: Build libluajit.a
run: make PLATFORM=iOS IOS_ARCH=arm64 all
- name: Verify archive
run: |
set -eu
lipo -info submodules/luajit/src/libluajit.a
lipo -info submodules/luajit/src/libluajit.a | grep -q arm64
- name: Attach to release
if: github.event.inputs.tag != ''
run: sh .forgejo/scripts/release-asset.sh submodules/luajit/src/libluajit.a hate-no-d-ios-arm64-luajit.a