palm-client: release workflow: a v* tag builds and tests the app and publishes visormesh-<tag>.prc with SHA256SUMS as a release; the toolchain install moves to tools/install_toolchain.sh so CI and the Dockerfile share the pinned versions
This commit is contained in:
1 parent
00feaffca5
commit
69fc4c0212
4 files changed
+87
-16
No files matched your search
@@ -0,0 +1,62 @@
|
||||
# Builds the Palm app and publishes it as a release when a v* tag is pushed
|
||||
# (hardware tags are hw-v*, so they don't match). The tag must match the
|
||||
# VERSION resource in palm-client/resources/visormesh.rcp, e.g. v0.2 for "0.2".
|
||||
# An annotated tag's message becomes the release notes.
|
||||
#
|
||||
# git tag -a v0.2 -m "What changed" && git push origin v0.2
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ['v*']
|
||||
|
||||
jobs:
|
||||
palm-client:
|
||||
runs-on: ubuntu-latest
|
||||
# Bookworm, for the toolchain .debs; Node, for actions/checkout.
|
||||
container: node:20-bookworm
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Toolchain
|
||||
run: sh palm-client/tools/install_toolchain.sh
|
||||
|
||||
- name: Version check
|
||||
run: |
|
||||
want="${GITHUB_REF_NAME#v}"
|
||||
have=$(sed -n 's/^VERSION ID 1 "\(.*\)"/\1/p' palm-client/resources/visormesh.rcp)
|
||||
if [ "$want" != "$have" ]; then
|
||||
echo "Tag $GITHUB_REF_NAME doesn't match VERSION \"$have\" in visormesh.rcp"; exit 1
|
||||
fi
|
||||
|
||||
- name: Build and test
|
||||
working-directory: palm-client
|
||||
run: make && make test
|
||||
|
||||
- name: Release
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -eu
|
||||
tag="$GITHUB_REF_NAME"
|
||||
api="$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY"
|
||||
mkdir -p dist
|
||||
cp palm-client/build/visormesh.prc "dist/visormesh-$tag.prc"
|
||||
(cd dist && sha256sum *.prc > SHA256SUMS)
|
||||
|
||||
git config --global --add safe.directory "$PWD"
|
||||
git fetch --depth=1 origin "+refs/tags/$tag:refs/tags/$tag"
|
||||
if [ "$(git cat-file -t "$tag")" = tag ]; then
|
||||
git for-each-ref "refs/tags/$tag" --format='%(contents:subject)%0a%0a%(contents:body)' > notes.txt
|
||||
else
|
||||
: > notes.txt
|
||||
fi
|
||||
body=$(python3 -c 'import json,sys; print(json.dumps(sys.stdin.read().strip()))' < notes.txt)
|
||||
|
||||
id=$(curl -fsS -X POST -H "Authorization: token $TOKEN" -H 'Content-Type: application/json' \
|
||||
-d "{\"tag_name\":\"$tag\",\"name\":\"VisorMesh $tag\",\"body\":$body}" "$api/releases" |
|
||||
python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')
|
||||
for f in dist/*; do
|
||||
curl -fsS -X POST -H "Authorization: token $TOKEN" \
|
||||
-F "attachment=@$f" "$api/releases/$id/assets?name=$(basename "$f")" >/dev/null
|
||||
done
|
||||
+3
-15
@@ -1,22 +1,10 @@
|
||||
# Palm OS 68k build environment: prc-tools-remix (m68k-palmos-gcc), PilRC,
|
||||
# and the Palm OS SDKs. The packages are amd64-only; on Apple Silicon Docker
|
||||
# runs this under emulation (build/run with --platform linux/amd64), which is fine for builds this small.
|
||||
# The versions are pinned in tools/install_toolchain.sh, which the release workflow also runs.
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
ARG PRC_TOOLS_VER=2.3.6
|
||||
ARG PILRC_TAG=2.3.91
|
||||
ARG PILRC_VER=3.2.91
|
||||
ARG PALM_SDK_COMMIT=1fa22066ca0f8b74949c14dd1d626294145d1c09
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends ca-certificates curl unzip make gcc libc6-dev python3-minimal \
|
||||
&& curl -fsSLo /tmp/prc.deb https://github.com/jichu4n/prc-tools-remix/releases/download/v${PRC_TOOLS_VER}/prc-tools-remix_${PRC_TOOLS_VER}.bookworm_amd64.deb \
|
||||
&& curl -fsSLo /tmp/pilrc.deb https://github.com/jichu4n/pilrc/releases/download/${PILRC_TAG}/pilrc_${PILRC_VER}.bookworm_amd64.deb \
|
||||
&& apt-get install -y --no-install-recommends /tmp/prc.deb /tmp/pilrc.deb \
|
||||
&& curl -fsSLo /tmp/sdk.zip https://github.com/jichu4n/palm-os-sdk/archive/${PALM_SDK_COMMIT}.zip \
|
||||
&& unzip -q /tmp/sdk.zip -d /tmp \
|
||||
&& mv /tmp/palm-os-sdk-${PALM_SDK_COMMIT} /opt/palmdev \
|
||||
&& palmdev-prep -d sdk-3.5 \
|
||||
&& rm -rf /tmp/*.deb /tmp/sdk.zip /var/lib/apt/lists/*
|
||||
COPY tools/install_toolchain.sh /tmp/install_toolchain.sh
|
||||
RUN sh /tmp/install_toolchain.sh && rm /tmp/install_toolchain.sh
|
||||
|
||||
WORKDIR /src
|
||||
@@ -11,7 +11,7 @@ make test # host-side tests for the protocol framing
|
||||
|
||||
If `m68k-palmos-gcc` isn't installed, `make` builds and runs the `visormesh-palm` Docker image (see `Dockerfile`) and does the build inside it. The first run takes a minute or two. The image is amd64-only, so on Apple Silicon it runs under emulation. That's fine for builds this small.
|
||||
|
||||
The toolchain versions and the palm-os-sdk commit are pinned in the `Dockerfile`.
|
||||
The toolchain versions and the palm-os-sdk commit are pinned in `tools/install_toolchain.sh`, which the `Dockerfile` and the release workflow both run.
|
||||
|
||||
Your editor's C checker can't see the Palm SDK headers, since they only exist inside the image. Errors like `'PalmOS.h' file not found` there are expected and don't affect the build.
|
||||
|
||||
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
# Installs the Palm OS 68k toolchain on Debian bookworm (amd64): prc-tools-remix,
|
||||
# PilRC and the Palm OS SDKs. Shared by the Dockerfile and the release workflow
|
||||
# (.gitea/workflows/release.yml), so both build with the same pinned versions.
|
||||
set -eu
|
||||
|
||||
PRC_TOOLS_VER=2.3.6
|
||||
PILRC_TAG=2.3.91
|
||||
PILRC_VER=3.2.91
|
||||
PALM_SDK_COMMIT=1fa22066ca0f8b74949c14dd1d626294145d1c09
|
||||
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends ca-certificates curl unzip make gcc libc6-dev python3-minimal
|
||||
curl -fsSLo /tmp/prc.deb https://github.com/jichu4n/prc-tools-remix/releases/download/v${PRC_TOOLS_VER}/prc-tools-remix_${PRC_TOOLS_VER}.bookworm_amd64.deb
|
||||
curl -fsSLo /tmp/pilrc.deb https://github.com/jichu4n/pilrc/releases/download/${PILRC_TAG}/pilrc_${PILRC_VER}.bookworm_amd64.deb
|
||||
apt-get install -y --no-install-recommends /tmp/prc.deb /tmp/pilrc.deb
|
||||
curl -fsSLo /tmp/sdk.zip https://github.com/jichu4n/palm-os-sdk/archive/${PALM_SDK_COMMIT}.zip
|
||||
unzip -q /tmp/sdk.zip -d /tmp
|
||||
mv /tmp/palm-os-sdk-${PALM_SDK_COMMIT} /opt/palmdev
|
||||
palmdev-prep -d sdk-3.5
|
||||
rm -rf /tmp/*.deb /tmp/sdk.zip /var/lib/apt/lists/*
|
||||
Reference in new issue
Block a user