Add Amiga workflow

This commit is contained in:
Cameron Armstrong (Nightfox) committed 2026-08-24 03:14:08 +08:00
1 parent 6a273c567b
commit 385c46ef39
2 files changed
+67

No files matched your search

+58
View File
@@ -0,0 +1,58 @@
name: amiga
on: [push, pull_request, workflow_dispatch]
concurrency:
group: ${{github.workflow}}-${{github.event.pull_request.number || github.ref}}
cancel-in-progress: true
permissions:
contents: read
jobs:
package:
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
# Ubuntu's `lha` package is lhasa: extract-only, cannot create archives.
# Build LHa for UNIX (https://github.com/jca02266/lha) instead.
- name: Install LHa for UNIX
working-directory: ${{runner.temp}}
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake
curl -fsSL -o lha.tar.gz \
https://github.com/jca02266/lha/archive/16619b066b189ef289bb8b07b37d1c38d550da99.tar.gz
tar -xzf lha.tar.gz
cd lha-16619b066b189ef289bb8b07b37d1c38d550da99
autoreconf -is
./configure --prefix="$HOME/.local"
make -j"$(nproc)"
make install
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Check lha can create archives
run: |
command -v lha
d=$(mktemp -d)
echo probe > "$d/f"
( cd "$d" && lha -aq2 t.lha f )
test -s "$d/t.lha"
- name: Pull compiler images
run: |
docker pull sacredbanana/amiga-compiler:m68k-amigaos &
docker pull sacredbanana/amiga-compiler:ppc-amigaos &
docker pull sacredbanana/amiga-compiler:ppc-morphos &
wait
- name: Build and package
run: ./package-amiga.sh
- uses: actions/upload-artifact@v4
with:
name: json-c.lha
path: dist/json-c.lha
if-no-files-found: error
+9
View File
@@ -18,6 +18,15 @@ STAGE=$DIST/stage
OSES=("$@"); [[ ${#OSES[@]} -eq 0 ]] && OSES=(AmigaOS3 AmigaOS4 MorphOS)
command -v lha >/dev/null || { echo "error: lha not found on PATH" >&2; exit 1; }
# Ubuntu's `lha` package is lhasa, which can only extract.
_lha_probe=$(mktemp -d)
echo x > "$_lha_probe/f"
if ! ( cd "$_lha_probe" && lha -aq2 t.lha f >/dev/null 2>&1 && [[ -s t.lha ]] ); then
echo "error: lha cannot create archives (is it lhasa?). Install LHa for UNIX: https://github.com/jca02266/lha" >&2
rm -rf "$_lha_probe"
exit 1
fi
rm -rf "$_lha_probe"
# Build straight into the staging tree by pointing AMIGA_SDK at it: the build
# script's SDK layout ($SDK/<target>) is the same shape we want per OS, so each