83 lines
3.3 KiB
YAML
83 lines
3.3 KiB
YAML
name: release
|
|
|
|
# Build the GAMEMAX LCD AppImage from source and attach it to a Gitea release.
|
|
# Trigger: push a tag like v1.0.0 (or run manually from the Actions tab).
|
|
|
|
on:
|
|
push:
|
|
tags: ["v*"]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
env:
|
|
# github.server_url mengikuti alamat saat runner didaftarkan dan bisa jadi IP internal,
|
|
# jadi URL yang disematkan ke dalam AppImage ditulis eksplisit di sini.
|
|
RELEASE_URL: https://gitea.oxpoe.qzz.io/oxpoe/Gamemax-linux-apps/releases/download
|
|
|
|
jobs:
|
|
appimage:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends \
|
|
libgl1 libegl1 libxkbcommon0 libdbus-1-3 libfuse2 fuse zsync libpython3.12
|
|
|
|
- name: Set up uv
|
|
# installers astral, bukan setup-uv: setup-v5 menembak API GitHub dan kena rate limit
|
|
run: curl -LsSf https://astral.sh/uv/install.sh | env INSTALLER_PREFIX=/usr/local sh
|
|
|
|
- name: Build AppImage
|
|
env:
|
|
APPIMAGE_EXTRACT_AND_RUN: "1"
|
|
UPDATE_INFO_URL: ${{ env.RELEASE_URL }}/${{ github.ref_name }}/GAMEMAX-LCD-x86_64.AppImage.zsync
|
|
run: bash packaging/build_appimage.sh
|
|
|
|
- name: Smoke test the bundle (no display)
|
|
env:
|
|
APPIMAGE_EXTRACT_AND_RUN: "1"
|
|
QT_QPA_PLATFORM: offscreen
|
|
run: |
|
|
./dist/GAMEMAX-LCD-x86_64.AppImage --selftest
|
|
|
|
- name: Checksum and zsync metadata
|
|
run: |
|
|
cd dist
|
|
sha256sum GAMEMAX-LCD-x86_64.AppImage > GAMEMAX-LCD-x86_64.AppImage.sha256
|
|
zsyncmake -u "${{ env.RELEASE_URL }}/${{ github.ref_name }}/GAMEMAX-LCD-x86_64.AppImage" \
|
|
-o GAMEMAX-LCD-x86_64.AppImage.zsync GAMEMAX-LCD-x86_64.AppImage
|
|
cat GAMEMAX-LCD-x86_64.AppImage.sha256
|
|
ls -l
|
|
|
|
- name: Publish release (Gitea API)
|
|
env:
|
|
TOKEN: ${{ github.token }}
|
|
run: |
|
|
API="${GITHUB_API_URL:-${GITHUB_SERVER_URL}/api/v1}"
|
|
TAG="${GITHUB_REF_NAME}"
|
|
cat > /tmp/body.md <<'EOF'
|
|
Linux bridge + tray app for the LCD panel of GAMEMAX IceBurg Digital AIO coolers.
|
|
|
|
**Download** `GAMEMAX-LCD-x86_64.AppImage`, then:
|
|
|
|
```bash
|
|
chmod +x GAMEMAX-LCD-x86_64.AppImage
|
|
./GAMEMAX-LCD-x86_64.AppImage
|
|
```
|
|
|
|
Verify with the published SHA-256, or use AppImageUpdate with the `.zsync` asset.
|
|
Independent project, not affiliated with the vendor.
|
|
EOF
|
|
python3 -c 'import json,sys;print(json.dumps({"tag_name":sys.argv[1],"name":"GAMEMAX LCD "+sys.argv[1],"body":open(sys.argv[2]).read()}))' "$TAG" /tmp/body.md > /tmp/rel.json
|
|
RID=$(curl -sf -X POST -H "Authorization: token $TOKEN" -H "Content-Type: application/json" "$API/repos/$GITHUB_REPOSITORY/releases" --data @/tmp/rel.json | python3 -c 'import json,sys;print(json.load(sys.stdin)["id"])')
|
|
echo "release id=$RID"
|
|
for f in dist/GAMEMAX-LCD-x86_64.AppImage dist/GAMEMAX-LCD-x86_64.AppImage.sha256 dist/GAMEMAX-LCD-x86_64.AppImage.zsync; do
|
|
[ -f "$f" ] || continue
|
|
curl -sf -X POST -H "Authorization: token $TOKEN" -F "attachment=@$f" "$API/repos/$GITHUB_REPOSITORY/releases/$RID/assets?name=$(basename "$f")" -o /dev/null
|
|
done
|