Address review feedback on the Amiga packaging PR.

Keep Amiga-specific files under amiga/, cache the pinned LHa binary in
CI, and make it explicit that the workflow artifact is not an official
release.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Cameron Armstrong (Nightfox)andCursor committed 2026-08-30 23:28:43 +08:00
1 parent 385c46ef39
commit 083d244d9a
5 files changed
+37 -18

No files matched your search

+19 -4
View File
@@ -1,5 +1,10 @@
name: amiga
# Verifies that AmigaOS 3/4 and MorphOS still cross-compile. The uploaded
# json-c.lha is a CI convenience artifact only — official json-c releases
# remain source-only. Aminet uploads are a separate, manual process and
# are not published from this job.
on: [push, pull_request, workflow_dispatch]
concurrency:
@@ -14,11 +19,19 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
# Ubuntu's `lha` package is lhasa: extract-only, cannot create archives.
# Build LHa for UNIX (https://github.com/jca02266/lha) instead.
- name: Cache LHa for UNIX
id: cache-lha
uses: actions/cache@v6
with:
path: ~/.local/bin/lha
key: lha-16619b066b189ef289bb8b07b37d1c38d550da99-${{ runner.os }}
- name: Install LHa for UNIX
if: steps.cache-lha.outputs.cache-hit != 'true'
working-directory: ${{runner.temp}}
run: |
sudo apt-get update
@@ -31,7 +44,9 @@ jobs:
./configure --prefix="$HOME/.local"
make -j"$(nproc)"
make install
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Add LHa to PATH
run: echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Check lha can create archives
run: |
@@ -49,9 +64,9 @@ jobs:
wait
- name: Build and package
run: ./package-amiga.sh
run: ./amiga/package-amiga.sh
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: json-c.lha
path: dist/json-c.lha
+7 -5
View File
@@ -275,7 +275,9 @@ make install
Building for Commodore Amiga or MorphOS
----------------------
Building for Commodore Amiga is supported for both Motorola 68k (AmigaOS 3) and PowerPC (AmigaOS 4) architectures. MorphOS on compatible PowerPC hardware is also supported. You can set up a cross compiler locally, however it is much easier to use the already preconfigured Amiga development environment wtthin a Docker container.
Building for Commodore Amiga is supported for both Motorola 68k (AmigaOS 3) and PowerPC (AmigaOS 4) architectures. MorphOS on compatible PowerPC hardware is also supported. You can set up a cross compiler locally, however it is much easier to use the already preconfigured Amiga development environment within a Docker container.
Included below are instructions for building for specific individual systems, as well as how to build for *all* Amiga variants.
Install Docker on your machine if you don't already have it. You can download Docker Desktop for Windows/macOS/Linux [here](https://www.docker.com/products/docker-desktop/).
@@ -384,19 +386,19 @@ cmake -DMORPHOS_BASEREL32=ON ..
### Building and packaging every variant
Two scripts at the repository root build the whole matrix across all three
Two scripts in the `amiga/` directory build the whole matrix across all three
systems, so you do not have to drive the container by hand.
* `build-amiga-sdk.sh [OS ...]` — builds every variant and installs
* `amiga/build-amiga-sdk.sh [OS ...]` — builds every variant and installs
`libjson-c.a` plus the `json-c/` headers into an SDK tree. The location comes
from `$AMIGA_SDK` (default `/opt/amiga`); either a `<target>/` or an
AmigaSDK-gcc-style `amigaos3/sdk/<target>/` layout is accepted, and an OS
whose subdirectory is absent is skipped rather than failing.
* `package-amiga.sh [OS ...]` — builds the same matrix into a staging tree and
* `amiga/package-amiga.sh [OS ...]` — builds the same matrix into a staging tree and
produces `dist/json-c.lha` for distribution.
Both default to `AmigaOS3 AmigaOS4 MorphOS`, and both take the variant list
from the same table in `build-amiga-sdk.sh`, so they cannot disagree. 22
from the same table in `amiga/build-amiga-sdk.sh`, so they cannot disagree. 22
libraries are built in total: 15 for AmigaOS 3 (newlib, libnix and clib2, each
across the five multilib slots), 3 for AmigaOS 4 (newlib, clib2, clib4) and 4
for MorphOS (ixemul and native, each with and without `-mbaserel32`).
@@ -2,14 +2,15 @@
# Cross-build json-c for Amiga systems across every multilib slot and install
# the archives plus headers into an SDK tree.
#
# ./build-amiga-sdk.sh [OS ...] # default: AmigaOS3 AmigaOS4 MorphOS
# ./amiga/build-amiga-sdk.sh [OS ...] # default: AmigaOS3 AmigaOS4 MorphOS
#
# SDK location comes from $AMIGA_SDK (default /opt/amiga).
set -uo pipefail
SDK=${AMIGA_SDK:-/opt/amiga}
cd "$(dirname "$0")"
ROOT=$PWD
AMIGA_DIR=$(cd "$(dirname "$0")" && pwd)
ROOT=$(cd "$AMIGA_DIR/.." && pwd)
cd "$ROOT"
OSES=("$@"); [[ ${#OSES[@]} -eq 0 ]] && OSES=(AmigaOS3 AmigaOS4 MorphOS)
# os | image tag | sdk subdir
+1 -1
View File
@@ -1,5 +1,5 @@
Short: JSON parser and generator library (static libs + headers)
Author: Michael Clark, Eric Haszlakiewicz et al.
Author: Michael Clark, Eric Hawicz et al.
Uploader: Cameron Armstrong (Nightfox) <cameronscottarmstrong@gmail.com>
Type: dev/lib
Version: 0.19
+6 -5
View File
@@ -2,7 +2,7 @@
# Build every json-c variant for the requested Amiga systems and package them
# into dist/json-c.lha.
#
# ./package-amiga.sh [OS ...] # default: all three
# ./amiga/package-amiga.sh [OS ...] # default: all three
#
# Archive layout (single directory at the root):
# json-c/json-c.readme
@@ -11,8 +11,9 @@
# json-c/MorphOS/...
set -uo pipefail
cd "$(dirname "$0")"
ROOT=$PWD
AMIGA_DIR=$(cd "$(dirname "$0")" && pwd)
ROOT=$(cd "$AMIGA_DIR/.." && pwd)
cd "$ROOT"
DIST=$ROOT/dist
STAGE=$DIST/stage
OSES=("$@"); [[ ${#OSES[@]} -eq 0 ]] && OSES=(AmigaOS3 AmigaOS4 MorphOS)
@@ -32,7 +33,7 @@ rm -rf "$_lha_probe"
# script's SDK layout ($SDK/<target>) is the same shape we want per OS, so each
# OS gets staged under its own directory.
rm -rf "$DIST"; mkdir -p "$STAGE/json-c"
cp "$ROOT/json-c.readme" "$STAGE/json-c/json-c.readme"
cp "$AMIGA_DIR/json-c.readme" "$STAGE/json-c/json-c.readme"
built=()
for os in "${OSES[@]}"; do
@@ -47,7 +48,7 @@ for os in "${OSES[@]}"; do
echo "=== $os ==="
# Stage whatever landed even if some variants failed -- a single unsupported
# multilib should not drop the whole OS from the archive.
AMIGA_SDK="$tmp" ./build-amiga-sdk.sh "$os" || echo " ($os: some variants failed, see above)"
AMIGA_SDK="$tmp" "$AMIGA_DIR/build-amiga-sdk.sh" "$os" || echo " ($os: some variants failed, see above)"
if [[ -n $(find "$tmp/$sub" -name 'libjson-c.a' -print -quit 2>/dev/null) ]]; then
mkdir -p "$STAGE/json-c/$os"
cp -a "$tmp/$sub/." "$STAGE/json-c/$os/"