Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
257 changes: 257 additions & 0 deletions .github/workflows/convert-screenshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
name: Convert screenshots to AVIF

# The pla-shots worker serves kazam0180/linux-app-shots, so a screenshot has to
# exist there before an app file may point at it. This workflow republishes the
# screenshots that still need converting, confirms the worker serves them, and
# then points the app files at it.
#
# Both changes land as pull requests rather than direct commits, one per repo.
# The worker serves the shots repository's default branch, so the screenshots
# only go live when that pull request is merged: merge the linux-app-shots pull
# request first, then the site's. Until then the worker check below reports the
# unserved URLs as a warning instead of failing the run.
on:
schedule:
- cron: "0 3 * * *"
workflow_dispatch:

permissions:
contents: write
pull-requests: write

concurrency:
group: convert-screenshots
cancel-in-progress: false

jobs:
convert:
runs-on: ubuntu-latest
container:
image: registry.gitlab.com/kazam0180/pla-site-tool:latest
steps:
- name: Checkout the site
uses: actions/checkout@v7
with:
path: site

- name: Checkout linux-app-shots
uses: actions/checkout@v7
with:
repository: kazam0180/linux-app-shots
path: shots
token: ${{ secrets.PLA_SHOTS_TOKEN }}

- name: Convert the screenshots
working-directory: site
run: |
set -e
# --shots-dir turns on sync mode: worker URLs in the app files are
# resolved through the manifest committed in linux-app-shots, their
# originals are re-fetched (ETag first, then a content hash), and
# the changed ones are re-converted into .cache. The manifest in
# the shots checkout is updated and pruned of entries no app file
# references anymore, and the shots-relative paths of what changed
# and what to delete are left in .cache/screenshots/changed.txt
# and pruned.txt.
imgtool -p . --shots-dir ../shots convert-screenshots

- name: Prune deleted screenshots
working-directory: site
run: |
set -e
# A published copy whose references are gone — its screenshot
# removed from the app file, or its app gone — is deleted here so
# the pull request stages the removal: imgtool lists the orphans
# in pruned.txt and never touches this checkout's screenshots
# itself. Copies whose app file was reverted to the original URL
# are not in the list; the run republishes through their record.
[ -s .cache/screenshots/pruned.txt ] || { echo "No prunes: the pruned list is empty."; exit 0; }
while read -r rel; do
[ -n "$rel" ] || continue
if [ -f "../shots/$rel" ]; then
rm "../shots/$rel"
echo "pruned $rel"
else
echo "$rel was already gone"
fi
done < .cache/screenshots/pruned.txt

- name: Publish the converted screenshots
working-directory: site
run: |
set -e
# imgtool converts and records; publishing stays here. changed.txt
# carries the shots-relative paths of everything republished this
# run, and each is copied from the conversion cache into the shots
# checkout, where the pull request carries it beside the manifest.
[ -s .cache/screenshots/changed.txt ] || { echo "Nothing to publish: the changed list is empty."; exit 0; }
while read -r rel; do
[ -n "$rel" ] || continue
src=".cache/screenshots/avif/$(basename "$rel" .avif).avif"
if [ ! -f "$src" ]; then
echo "::warning::$rel changed but has no converted file"
continue
fi
mkdir -p "../shots/$(dirname "$rel")"
cp "$src" "../shots/$rel"
done < .cache/screenshots/changed.txt

- name: Open the linux-app-shots pull request
working-directory: shots
env:
GH_TOKEN: ${{ secrets.PLA_SHOTS_TOKEN }}
run: |
set -e
# The publish step has copied the changed AVIFs into this checkout,
# the prune step has deleted the copies whose references are gone,
# and imgtool has updated manifest.json — one commit carries
# records, their bytes and their removals together. Stage exactly
# that instead of `git add -A`, which would sweep in any unrelated
# change sitting in the checkout. imgtool writes both lists on
# every sync run, empty when there is nothing to do.
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
base=$(git ls-remote --symref origin HEAD | awk 'NR==1 { sub(/^refs\/heads\//, "", $2); print $2 }')
git fetch --force origin "$base"
# The pull-request branch is rebuilt from the default branch every
# run, so the pull request always shows exactly this run's changes.
# Only this workflow writes the branch — the concurrency group
# serializes runs and nothing else touches this repo — which is
# why the push may force.
git checkout -B convert-screenshots "origin/$base"
git add manifest.json
while read -r rel; do
[ -n "$rel" ] || continue
git add -- "$rel" || echo "::warning::$rel changed but could not be staged"
done < ../site/.cache/screenshots/changed.txt
while read -r rel; do
[ -n "$rel" ] || continue
git add -- "$rel" || echo "::warning::$rel pruned but could not be staged"
done < ../site/.cache/screenshots/pruned.txt
if git diff --cached --quiet; then
echo "Nothing new to publish: no linux-app-shots pull request this run."
exit 0
fi
changed=$(wc -l < ../site/.cache/screenshots/changed.txt)
pruned=$(wc -l < ../site/.cache/screenshots/pruned.txt)
git commit -m "chore: sync converted screenshots ($changed changed, $pruned pruned)"
git push --force origin convert-screenshots
printf '{"title":"Sync converted screenshots","head":"convert-screenshots","base":"%s","body":"Automated screenshot conversion.\\n\\nMerge this before the matching Portable-Linux-Apps pull request, so the pla-shots worker serves every screenshot URL the app files reference."}' "$base" > /tmp/pull.json
code=$(curl -sS -o /tmp/pull-reply.json -w '%{http_code}' -X POST \
-H "Authorization: Bearer $GH_TOKEN" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/kazam0180/linux-app-shots/pulls \
--data-binary @/tmp/pull.json)
if [ "$code" = 201 ]; then
echo "Opened the linux-app-shots pull request"
elif [ "$code" = 422 ] && grep -q 'already exists' /tmp/pull-reply.json; then
echo "Pull request already open; pushed the new commit onto it"
else
echo "::error::Opening the linux-app-shots pull request failed (HTTP $code)"
cat /tmp/pull-reply.json
exit 1
fi

- name: Confirm the worker serves what the app files will point at
working-directory: site
run: |
set -e
# Two sets of URLs matter: the shots this run republished
# (changed.txt, written by imgtool), and any worker URL in the app
# files this run is about to commit. A reference that was already
# broken before this run is not its doing. linux-app-shots sits
# behind Cloudflare, which can lag the push by a minute or so, so
# an unresolved URL is retried before it is reported.
#
# Both changes land on pull request branches this run, and the
# worker serves the shots repository's default branch, so the new
# screenshots stay unserved until the shots pull request is
# merged. This check is therefore advisory: a miss is a warning on
# the run, not a failure. Merge the shots pull request first.
: > /tmp/toverify.txt
if [ -f .cache/screenshots/changed.txt ]; then
sed 's#^#https://pla-shots.mrcreamy112233.workers.dev/#' \
.cache/screenshots/changed.txt >> /tmp/toverify.txt || true
fi
git diff --name-only apps/ > /tmp/changed-apps.txt || true
while read -r f; do
[ -n "$f" ] || continue
grep -hoE 'https://pla-shots\.mrcreamy112233\.workers\.dev/[^[:space:]]+\.avif' "$f" 2>/dev/null \
| sed 's#^https://pla-shots\.mrcreamy112233\.workers\.dev/##' >> /tmp/toverify.txt || true
done < /tmp/changed-apps.txt
sort -u /tmp/toverify.txt -o /tmp/toverify.txt

if [ ! -s /tmp/toverify.txt ]; then
echo "Nothing to confirm: no changed shots and no app file changes."
exit 0
fi

cp /tmp/toverify.txt /tmp/pending.txt
for round in 1 2 3 4 5 6; do
[ -s /tmp/pending.txt ] || break
: > /tmp/still.txt
while read -r rel; do
# Same UA imgtool sends: a Cloudflare WAF/bot rule can 403 the
# default curl UA and fail the step spuriously.
code=$(curl -sS \
-A 'Mozilla/5.0 (imgtool; +https://portable-linux-apps.github.io)' \
-o /dev/null -w '%{http_code}' \
"https://pla-shots.mrcreamy112233.workers.dev/$rel" || true)
[ "$code" = "200" ] || echo "$rel" >> /tmp/still.txt
done < /tmp/pending.txt
mv /tmp/still.txt /tmp/pending.txt
[ -s /tmp/pending.txt ] && sleep 20
done

if [ -s /tmp/pending.txt ]; then
echo "::warning::$(wc -l < /tmp/pending.txt) screenshot(s) the app files point at are not being served — expected while the linux-app-shots pull request is unmerged. Merge it first; if URLs are still missing afterwards, re-run this workflow:"
cat /tmp/pending.txt
exit 0
fi
echo "All $(wc -l < /tmp/toverify.txt) screenshot(s) confirmed on the worker"

- name: Open the site pull request
working-directory: site
env:
GH_TOKEN: ${{ github.token }}
API_URL: https://api.github.com/repos/${{ github.repository }}
run: |
set -e
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add apps/
if git diff --cached --quiet; then
echo "No app file changes: no site pull request this run."
exit 0
fi
git commit -m "chore: point screenshots at the pla-shots worker"
git checkout -B convert-screenshots
base=$(git ls-remote --symref origin HEAD | awk 'NR==1 { sub(/^refs\/heads\//, "", $2); print $2 }')
# sync-with-AM commits apps/ every 30 minutes, so the branch is
# rebased onto the current default branch before pushing — that
# keeps the pull request showing only this run's app-file changes.
for attempt in 1 2 3; do
git fetch --force origin "$base"
if git rebase "origin/$base"; then
break
fi
git rebase --abort 2>/dev/null || true
[ "$attempt" = 3 ] && { echo "::error::Could not rebase the app files onto origin/$base"; exit 1; }
echo "Rebase failed, retrying with a fresh fetch (attempt $attempt of 3)"
done
git push --force origin convert-screenshots
printf '{"title":"Point screenshots at the pla-shots worker","head":"convert-screenshots","base":"%s","body":"Automated app-file update.\\n\\nMerge this **after** the linux-app-shots screenshots pull request has been merged, so the pla-shots worker serves every URL these app files reference."}' "$base" > /tmp/pull.json
code=$(curl -sS -o /tmp/pull-reply.json -w '%{http_code}' -X POST \
-H "Authorization: Bearer $GH_TOKEN" \
-H "Accept: application/vnd.github+json" \
"$API_URL/pulls" \
--data-binary @/tmp/pull.json)
if [ "$code" = 201 ]; then
echo "Opened the site pull request"
elif [ "$code" = 422 ] && grep -q 'already exists' /tmp/pull-reply.json; then
echo "Pull request already open; pushed the new commit onto it"
else
echo "::error::Opening the site pull request failed (HTTP $code)"
cat /tmp/pull-reply.json
exit 1
fi
21 changes: 1 addition & 20 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,12 @@ jobs:
path: .cache/icons
key: icons-${{ hashFiles('icons/**', 'no-icon.png') }}

- name: Cache screenshots
id: screenshots-cache
uses: actions/cache@v6
with:
path: .cache/screenshots
key: screenshots-v1

- name: Build site
shell: bash
run: |
set -e

pla-site-tool gen-site > pla-site-tool.log 2>&1 &
PLA_PID=$!

imgtool -p . -o ./public convert-screenshots > screenshots.log 2>&1 &
SS_PID=$!

wait "$PLA_PID"; PLA_STATUS=$?
wait "$SS_PID"; SS_STATUS=$?

cat pla-site-tool.log screenshots.log | tee -a build-log.txt

[ $PLA_STATUS -eq 0 ] || { echo "pla-site-tool failed" | tee -a build-log.txt; exit 1; }
[ $SS_STATUS -eq 0 ] || { echo "imgtool convert-screenshots failed" | tee -a build-log.txt; exit 1; }
pla-site-tool gen-site 2>&1 | tee -a build-log.txt

[ ! -x ./minify ] && chmod a+x ./minify
./minify public 2>&1 | tee -a build-log.txt
Expand Down
2 changes: 1 addition & 1 deletion apps/0ad
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This is the official AppImage.
===
# SCREENSHOTS: https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/0ad/1.webp
# SCREENSHOTS: https://pla-shots.mrcreamy112233.workers.dev/0ad/1.avif
# SITES: https://play0ad.com
# SOURCES:
# BUTTONS:
2 changes: 1 addition & 1 deletion apps/0ad-prerelease
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This script installs the latest official development build. For the Stable release, see "0ad".
===
# SCREENSHOTS: https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/0ad-prerelease/1.webp
# SCREENSHOTS: https://pla-shots.mrcreamy112233.workers.dev/0ad-prerelease/1.avif
# SITES: https://play0ad.com
# SOURCES:
# BUTTONS:
2 changes: 1 addition & 1 deletion apps/0x808
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ A standalone drum machine, step sequencer, and synthesizer — also available as
- **Pattern presets** — 12 drum patterns + 10 bass lines (House, Trap, DnB, Lo-fi, etc.)
- **Multiple frontends** — ImGui (standalone + plugin) and GTK 4.0 (Linux native)
===
# SCREENSHOTS: Animated_Demo::https://github.com/averagenative/0x808/raw/main/0x808_demo.gif GTK::https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/0x808/1.webp Light_Theme::https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/0x808/2.webp Dark_Theme::https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/0x808/3.webp Hacker_Theme::https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/0x808/4.webp
# SCREENSHOTS: Animated_Demo::https://github.com/averagenative/0x808/raw/main/0x808_demo.gif GTK::https://pla-shots.mrcreamy112233.workers.dev/0x808/1.avif Light_Theme::https://pla-shots.mrcreamy112233.workers.dev/0x808/2.avif Dark_Theme::https://pla-shots.mrcreamy112233.workers.dev/0x808/3.avif Hacker_Theme::https://pla-shots.mrcreamy112233.workers.dev/0x808/4.avif
# SITES: https://github.com/averagenative/0x808
2 changes: 1 addition & 1 deletion apps/0xfx
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ Real-time guitar effects processor and amp simulator. Standalone app + CLAP/VST3

**12 amp models** (circuit-modeled from real schematics) | **41 effect pedals** | **9 rack processors** | **10 mic models** | **137 automatable parameters** | **32 factory presets**
===
# SCREENSHOTS: Main_View::https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/0xfx/1.webp Preset_Browser::https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/0xfx/2.webp amp_selector::https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/0xfx/3.webp Looper_Panel::https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/0xfx/4.webp Theme_Selector::https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/0xfx/5.webp Rack_Effects::https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/0xfx/6.webp
# SCREENSHOTS: Main_View::https://pla-shots.mrcreamy112233.workers.dev/0xfx/1.avif Preset_Browser::https://pla-shots.mrcreamy112233.workers.dev/0xfx/2.avif amp_selector::https://pla-shots.mrcreamy112233.workers.dev/0xfx/3.avif Looper_Panel::https://pla-shots.mrcreamy112233.workers.dev/0xfx/4.avif Theme_Selector::https://pla-shots.mrcreamy112233.workers.dev/0xfx/5.avif Rack_Effects::https://pla-shots.mrcreamy112233.workers.dev/0xfx/6.avif
# SITES: https://github.com/averagenative/0xfx
2 changes: 1 addition & 1 deletion apps/0xsynth
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ Multi-engine synthesizer (subtractive/FM/wavetable) — CLAP/VST3 plugin + stand
- **MPE support** — per-note pitch bend, pressure, slide
- **2x/4x oversampling** — reduces aliasing in oscillators
===
# SCREENSHOTS: Dark_Recording_Settings::https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/0xsynth/0.webp Light_User_Presets::https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/0xsynth/1.webp Midnight_FM::https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/0xsynth/2.webp Vaporwave_Wavetable::https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/0xsynth/3.webp
# SCREENSHOTS: Dark_Recording_Settings::https://pla-shots.mrcreamy112233.workers.dev/0xsynth/0.avif Light_User_Presets::https://pla-shots.mrcreamy112233.workers.dev/0xsynth/1.avif Midnight_FM::https://pla-shots.mrcreamy112233.workers.dev/0xsynth/2.avif Vaporwave_Wavetable::https://pla-shots.mrcreamy112233.workers.dev/0xsynth/3.avif
# SITES: https://github.com/averagenative/0xsynth
8 changes: 8 additions & 0 deletions apps/432hz-player
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 432hz-player
===
Most music is recorded in 440hz. Many people claim that 432hz resonates more with the heart whereas 440hz resonates more with the brain, and that 432hz music feels better. Try it yourself. Play a music in 440hz and in 432hz, and see which one you prefer. Most people choose the 432hz version, and it's hard to go back to 440hz.

This application uses a very high-quality pitch-shifting algorithm with low CPU usage.
===
# SCREENSHOTS: https://pla-shots.mrcreamy112233.workers.dev/432hz-player/1.avif
# SITES: https://github.com/mysteryx93/NaturalGroundingPlayer
2 changes: 1 addition & 1 deletion apps/4kwall
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
Browse, search, download, organize and automatically rotate millions of beautiful HD, 4K & 8K wallpapers.
===

# SCREENSHOTS: https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/4kwall/1.webp https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/4kwall/2.webp https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/4kwall/3.webp https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/4kwall/4.webp https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/4kwall/5.webp
# SCREENSHOTS: https://pla-shots.mrcreamy112233.workers.dev/4kwall/1.avif https://pla-shots.mrcreamy112233.workers.dev/4kwall/2.avif https://pla-shots.mrcreamy112233.workers.dev/4kwall/3.avif https://pla-shots.mrcreamy112233.workers.dev/4kwall/4.avif https://pla-shots.mrcreamy112233.workers.dev/4kwall/5.avif
# SITES: https://github.com/rishabh3354/4KWALL
2 changes: 1 addition & 1 deletion apps/6502-emulator
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
===
Emulator for the AC6502 family of computers.
===
# SCREENSHOTS: https://raw.githubusercontent.com/kazam0180/linux-app-shots/refs/heads/main/6502-emulator/1.webp
# SCREENSHOTS: https://pla-shots.mrcreamy112233.workers.dev/6502-emulator/1.avif
# SITES: https://github.com/acwright/6502-emulator
Loading
Loading