From 0954f5cbfcb4d5c9c893064e3b118c0f15e5b92d Mon Sep 17 00:00:00 2001 From: pedro-bento Date: Wed, 21 Oct 2026 21:14:05 +0100 Subject: [PATCH] Fix pipeline --- .forgejo/workflows/apple.yml | 96 ++++++++++++++++++++++++++++++++++ .forgejo/workflows/release.yml | 92 ++++++++------------------------ README.md | 8 +-- 3 files changed, 121 insertions(+), 75 deletions(-) create mode 100644 .forgejo/workflows/apple.yml diff --git a/.forgejo/workflows/apple.yml b/.forgejo/workflows/apple.yml new file mode 100644 index 0000000..7a2d7d8 --- /dev/null +++ b/.forgejo/workflows/apple.yml @@ -0,0 +1,96 @@ +# 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 diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index 5b5c678..f0ffd1d 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -6,15 +6,15 @@ # # Release assets are uploaded straight to the REST API, one file per platform: # hate-no-d-linux-{x86_64,i686,aarch64,armv7} -# hate-no-d-macos-{arm64,x86_64} # hate-no-d-android-{arm64-v8a,armeabi-v7a,x86_64} # hate-no-d-windows_mingw_w64-{x64,x86}.exe -# hate-no-d-ios-arm64-luajit.a # hate-no-d-freebsd-x86_64 # -# Only Apple's targets need more than the Linux runner, and they are gated -# behind a repository variable set to "true" (needs a matching runner): -# ENABLE_MACOS (macOS runner, label: macos) -> macos + ios jobs +# apple.yml adds hate-no-d-macos-{arm64,x86_64} and hate-no-d-ios-arm64-luajit.a +# when it is dispatched against a Mac runner. +# +# Everything in this file builds on a Linux runner: FreeBSD inside a QEMU guest, +# Windows cross-compiled with mingw-w64. name: release on: @@ -80,7 +80,10 @@ jobs: - name: Checkout uses: https://data.forgejo.org/actions/checkout@v4 with: - submodules: recursive + submodules: false + + - name: Fetch submodules + run: git submodule update --init --recursive - name: Install toolchain run: | @@ -122,7 +125,10 @@ jobs: - name: Checkout uses: https://data.forgejo.org/actions/checkout@v4 with: - submodules: recursive + submodules: false + + - name: Fetch submodules + run: git submodule update --init --recursive - name: Install toolchain # gcc-multilib is needed for the 32-bit host tools LuaJIT requires when @@ -169,68 +175,6 @@ jobs: sh .forgejo/scripts/release-asset.sh "dist/hate-no-d-android-$abi" "hate-no-d-android-$abi" done - # --------------------------------------------------------------------------- - # 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 }} - if: vars.ENABLE_MACOS == 'true' - 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: 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: startsWith(github.ref, 'refs/tags/') - 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 - if: vars.ENABLE_MACOS == 'true' - runs-on: macos - steps: - - name: Checkout - uses: https://data.forgejo.org/actions/checkout@v4 - with: - submodules: 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: startsWith(github.ref, 'refs/tags/') - run: sh .forgejo/scripts/release-asset.sh submodules/luajit/src/libluajit.a hate-no-d-ios-arm64-luajit.a - # --------------------------------------------------------------------------- # FreeBSD. Built inside a FreeBSD VM booted with QEMU/KVM on the Linux runner, # so no FreeBSD runner is needed: the tooling lives on the Linux side and only @@ -253,7 +197,10 @@ jobs: - name: Checkout uses: https://data.forgejo.org/actions/checkout@v4 with: - submodules: recursive + submodules: false + + - name: Fetch submodules + run: git submodule update --init --recursive - name: Install QEMU run: | @@ -303,7 +250,10 @@ jobs: - name: Checkout uses: https://data.forgejo.org/actions/checkout@v4 with: - submodules: recursive + submodules: false + + - name: Fetch submodules + run: git submodule update --init --recursive # libc6-dev is not pulled in by gcc under --no-install-recommends, and # without it the host build of minilua cannot find limits.h. diff --git a/README.md b/README.md index 5f5bfd9..85e4b7a 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@ A [Love2D](https://www.love2d.org/) antagonist. ## Quick Start -### On Linux, macOS, BSD or POSIX +### On Linux, macOS, BSD, POSIX or Windows-MinGW ```sh echo -e 'print("Hey! I am hate-no-d!")' > quick-start.lua ./hate-no-d quick-start.lua ``` -### On Windows +### On Windows MSVC ```bat echo print("Hey! I am hate-no-d!") > quick-start.lua @@ -20,7 +20,7 @@ hate-no-d.exe quick-start.lua ## Build -### On Linux, macOS, BSD or POSIX +### On Linux, macOS, BSD, POSIX or Windows-MinGW ```sh git clone --recurse-submodules https://git.pbento.pt/pedro-bento/hate-no-d.git @@ -28,7 +28,7 @@ cd hate-no-d make ``` -### On Windows +### On Windows MSVC ```bat git clone --recurse-submodules https://git.pbento.pt/pedro-bento/hate-no-d.git