79 lines
3.0 KiB
YAML
79 lines
3.0 KiB
YAML
# Manual end-to-end proof of the AppImage self-update between two PUBLISHED releases (Linux x64).
|
|
# Downloads the older release's AppImage anonymously, runs it in a disposable profile under Xvfb with
|
|
# APPIMAGE_EXTRACT_AND_RUN, lets it update itself from git.eeee.moe and checks version + identity afterwards.
|
|
# Uses no secrets; never runs on pull requests.
|
|
name: update-e2e
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
from_tag:
|
|
description: Older updater-capable release tag (e.g. v0.1.2-rc.1)
|
|
required: true
|
|
to_tag:
|
|
description: Newer release tag the old one must update to (e.g. v0.1.2-rc.2)
|
|
required: true
|
|
new_prefs:
|
|
description: Optional JSON of settings that exist only in the new version, applied after the update and checked after a restart
|
|
required: false
|
|
default: ''
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
appimage-x64:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: node:22-bookworm
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: System packages (container only)
|
|
run: |
|
|
set -euo pipefail
|
|
apt-get update
|
|
apt-get install -y --no-install-recommends ca-certificates curl xvfb xauth libnss3 libatk1.0-0 \
|
|
libatk-bridge2.0-0 libcups2 libdrm2 libgbm1 libgtk-3-0 libasound2 libxss1 libxshmfence1 \
|
|
libxkbcommon0 libxcomposite1 libxdamage1 libxrandr2 libpango-1.0-0
|
|
|
|
- name: Test driver (playwright-core)
|
|
run: npm ci
|
|
|
|
- name: Download the older published AppImage (anonymous)
|
|
env:
|
|
FROM_TAG: ${{ inputs.from_tag }}
|
|
run: |
|
|
set -euo pipefail
|
|
[[ "$FROM_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]] || { echo "bad tag $FROM_TAG"; exit 2; }
|
|
mkdir -p old
|
|
curl -fsSL -o "old/TeamsPeach-${FROM_TAG#v}.AppImage" \
|
|
"https://git.eeee.moe/TeamsPeach/client/releases/download/${FROM_TAG}/TeamsPeach-${FROM_TAG#v}.AppImage"
|
|
sha256sum old/*.AppImage
|
|
|
|
- name: Self-update end to end
|
|
env:
|
|
FROM_TAG: ${{ inputs.from_tag }}
|
|
TO_TAG: ${{ inputs.to_tag }}
|
|
NEW_PREFS: ${{ inputs.new_prefs }}
|
|
run: |
|
|
set -euo pipefail
|
|
[[ "$TO_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]] || { echo "bad tag $TO_TAG"; exit 2; }
|
|
if [ -n "$NEW_PREFS" ]; then
|
|
node -e 'const p = JSON.parse(process.argv[1]); if (!p || typeof p !== "object" || Array.isArray(p)) process.exit(2)' "$NEW_PREFS"
|
|
xvfb-run -a node scripts/update-e2e.mjs --from "old/TeamsPeach-${FROM_TAG#v}.AppImage" --to-tag "$TO_TAG" --out update-e2e-out --new-prefs "$NEW_PREFS"
|
|
else
|
|
xvfb-run -a node scripts/update-e2e.mjs --from "old/TeamsPeach-${FROM_TAG#v}.AppImage" --to-tag "$TO_TAG" --out update-e2e-out
|
|
fi
|
|
cat update-e2e-out/result.json
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
if: always()
|
|
with:
|
|
name: update-e2e
|
|
path: update-e2e-out/
|