hate-no-d/.forgejo/workflows/apple.yml
pedro-bento 3b9bbd529a
All checks were successful
release / linux/aarch64 (push) Successful in 1m55s
release / linux/armv7 (push) Successful in 2m18s
release / linux/i686 (push) Successful in 2m11s
release / linux/x86_64 (push) Successful in 1m54s
release / android (push) Successful in 2m50s
release / freebsd/x86_64 (push) Successful in 4m55s
release / windows/i686 (push) Successful in 2m7s
release / windows/x86_64 (push) Successful in 2m11s
Add raylib
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-22 22:47:20 +01:00

66 lines
2.1 KiB
YAML

# macOS, kept out of release.yml: it needs a `macos` runner. Gating it there
# with `if: vars.*` does not work -- Forgejo does not evaluate `vars` in `if:`,
# so the job queued forever and the run never finished. Manual dispatch only,
# until a Mac runner exists.
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. The SDKs are universal: only target objects get -arch.
# ---------------------------------------------------------------------------
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 is dumb HTTP and rejects the --depth that checkout's
# submodule support always passes, so clone it here in full.
- name: Fetch submodules
run: git submodule update --init --recursive
- name: Install LuaJIT
run: brew install luajit
- 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: Package
run: |
sh .forgejo/scripts/make-archive.sh "hate-no-d-macos-${{ matrix.arch }}" tar.gz \
./hate-no-d ./hate-no-d.lua
- name: Attach to release
if: github.event.inputs.tag != ''
run: sh .forgejo/scripts/release-asset.sh "./hate-no-d-macos-${{ matrix.arch }}.tar.gz"