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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 172 additions & 0 deletions .github/workflows/fade-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
name: Fade apps

# Builds the downloadable Fade apps and publishes them to the "fade-mac" release from main:
# macOS Fade-macOS-AppleSilicon.dmg + Fade-macOS-Intel.dmg
# The apps are thin native windows around the live site, so every push to the site reaches them through GitHub
# Pages without a rebuild. This workflow only runs when the shell in desktop/ changes. Every build is opened and
# checked on its own system first; only builds that passed are published, and the download links never change.
on:
push:
branches: [main]
paths:
- 'apps/fade/shell/desktop/**'
- '.github/workflows/fade-mac.yml'
pull_request:
paths:
- 'apps/fade/shell/desktop/**'
- '.github/workflows/fade-mac.yml'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: fade-mac-${{ github.ref }}
cancel-in-progress: true

jobs:
desktop:
name: Desktop (${{ matrix.name }})
strategy:
fail-fast: false
matrix:
include:
- name: macOS Apple silicon
os: macos-15
- name: macOS Intel
os: macos-15-intel
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install PyInstaller, Pillow and pywebview
run: python -m pip install --disable-pip-version-check pyinstaller pillow pywebview
- name: Install Inno Setup
if: runner.os == 'Windows'
shell: pwsh
run: |
$iscc = Join-Path ${env:ProgramFiles(x86)} 'Inno Setup 6\ISCC.exe'
if (-not (Test-Path $iscc) -and -not (Get-Command iscc -ErrorAction SilentlyContinue)) {
choco install innosetup --no-progress -y
}
- name: Make sure the WebView2 runtime is there (the Windows window uses it)
if: runner.os == 'Windows'
shell: pwsh
run: |
$client = '{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}'
$keys = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\$client",
"HKCU:\Software\Microsoft\EdgeUpdate\Clients\$client"
$version = $keys | Where-Object { Test-Path $_ } | ForEach-Object { (Get-ItemProperty $_).pv } |
Where-Object { $_ -and $_ -ne '0.0.0.0' } | Select-Object -First 1
if ($version) { Write-Host "WebView2 runtime $version"; exit 0 }
$setup = Join-Path $env:RUNNER_TEMP 'MicrosoftEdgeWebview2Setup.exe'
Invoke-WebRequest 'https://go.microsoft.com/fwlink/p/?LinkId=2124703' -OutFile $setup
Start-Process -FilePath $setup -ArgumentList '/silent', '/install' -Wait
- name: Stop XProtect scans (they make hdiutil fail with "Resource busy")
if: runner.os == 'macOS'
run: |
sudo pkill -9 XProtect > /dev/null 2>&1 || true
for attempt in $(seq 1 20); do pgrep -x XProtect > /dev/null || break; sleep 3; done
- name: Build and package
run: python apps/fade/shell/desktop/build.py --require-installer
- name: Open the built app and check its window shows this commit's Fade
run: python apps/fade/shell/desktop/smoke_test.py --built --local-site
- name: Install with Fade-Windows-Setup.exe, run it, uninstall it
if: runner.os == 'Windows'
shell: pwsh
run: |
$setup = Resolve-Path 'apps/fade/shell/desktop/dist/Fade-Windows-Setup.exe'
$log = Join-Path $env:RUNNER_TEMP 'fade-setup.log'
$process = Start-Process -FilePath $setup -Wait -PassThru -ArgumentList @(
'/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART', '/TASKS=desktopicon', "/LOG=$log")
if ($process.ExitCode -ne 0) { Get-Content $log -Tail 40; throw "Setup failed with exit code $($process.ExitCode)" }
$app = Join-Path $env:LOCALAPPDATA 'Programs\Fade\Fade.exe'
if (-not (Test-Path $app)) { throw "Fade.exe was not installed to $app" }
$shortcuts = @(
(Join-Path ([Environment]::GetFolderPath('Programs')) 'Fade.lnk'),
(Join-Path ([Environment]::GetFolderPath('Desktop')) 'Fade.lnk'))
foreach ($link in $shortcuts) { if (-not (Test-Path $link)) { throw "Missing shortcut: $link" } }
$entry = Get-ChildItem 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall' |
Get-ItemProperty | Where-Object DisplayName -eq 'Fade'
if (-not $entry) { throw 'Fade is missing from Settings > Apps' }
python apps/fade/shell/desktop/smoke_test.py --local-site $app
if ($LASTEXITCODE -ne 0) { throw 'The installed app failed its checks' }
Start-Process -FilePath $entry.UninstallString.Trim('"') -Wait -ArgumentList '/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART'
for ($i = 0; $i -lt 60 -and (Test-Path $app); $i++) { Start-Sleep -Seconds 1 }
if (Test-Path $app) { throw 'Uninstalling left Fade.exe behind' }
foreach ($link in $shortcuts) { if (Test-Path $link) { throw "Uninstalling left a shortcut: $link" } }
Write-Host 'Installed, ran and uninstalled cleanly'
- name: Check the Mac app and disk image
if: runner.os == 'macOS'
run: |
APP=apps/fade/shell/desktop/dist/Fade.app
test "$(plutil -extract CFBundleIdentifier raw "$APP/Contents/Info.plist")" = "io.github.juw12.fade.desktop"
test "$(plutil -extract CFBundleShortVersionString raw "$APP/Contents/Info.plist")" = "$(python3 -c 'import json; print(json.load(open("apps/fade/shell/desktop/shell.json"))["version"])')"
echo "Architecture: $(lipo -archs "$APP/Contents/MacOS/Fade")"
codesign --verify --deep --verbose=2 "$APP"
for image in apps/fade/shell/desktop/dist/*.dmg; do hdiutil verify "$image"; done
- uses: actions/upload-artifact@v4
with:
name: Fade-${{ runner.os }}-${{ runner.arch }}
path: apps/fade/shell/desktop/dist/Fade-*
if-no-files-found: error
retention-days: 14

publish:
needs: [desktop]
if: ${{ !cancelled() && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: Fade-*
path: dist
merge-multiple: true
- name: Publish the apps to the apps release
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
run: |
cd dist
FILES=""
for name in Fade-macOS-AppleSilicon.dmg Fade-macOS-Intel.dmg; do
if [ -f "$name" ]; then
FILES="$FILES $name"
else
echo "::warning::$name was not built in this run; the release keeps its previous copy (if any)."
fi
done
if [ -z "$FILES" ]; then
echo "::error::No app passed its checks."
exit 1
fi
sha256sum $FILES > SHA256SUMS.txt
cat SHA256SUMS.txt
cat > notes.md <<'EOF'
**Fade**: book barbers anywhere, watch haircut shorts and earn creator. The apps open the same Fade as https://juw12.github.io/projects/fade/ in their own window.

| Your device | Download | How to install |
| --- | --- | --- |
| **Mac with Apple chip (M1 and newer)** | [Fade-macOS-AppleSilicon.dmg](https://github.com/juw12/projects/releases/download/fade-mac/Fade-macOS-AppleSilicon.dmg) | Open it and drag Fade to Applications. The first time, macOS blocks it because it is not notarized: **System Settings → Privacy & Security → Open Anyway**. |
| **Mac with Intel chip** | [Fade-macOS-Intel.dmg](https://github.com/juw12/projects/releases/download/fade-mac/Fade-macOS-Intel.dmg) | Same as above. Not sure which Mac? Apple menu → About This Mac shows **Chip** (Apple) or **Processor** (Intel). |
| **iPhone / iPad** | [Open in Safari](https://juw12.github.io/projects/fade/) | Share → **Add to Home Screen** (free, full screen, updates itself). |
| **Android** | [Fade-android.apk](https://github.com/juw12/projects/releases/download/fade-android/Fade-android.apk) | Open the file on the phone and allow your browser to install apps once. |

The apps load Fade from the web, so new versions arrive the moment they are published, with no reinstall. Checksums for this build: `SHA256SUMS.txt`.
EOF
{
echo
echo "Built from ${GITHUB_SHA::7}."
} >> notes.md
if gh release view fade-mac --repo "$REPO" > /dev/null 2>&1; then
gh release upload fade-mac $FILES SHA256SUMS.txt --clobber --repo "$REPO"
gh release edit fade-mac --notes-file notes.md --repo "$REPO"
else
gh release create fade-mac $FILES SHA256SUMS.txt --title "Fade for Mac" \
--notes-file notes.md --latest=false --repo "$REPO"
fi
172 changes: 172 additions & 0 deletions .github/workflows/me-rd-toolkit-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
name: DatumBench apps

# Builds the downloadable DatumBench apps and publishes them to the "me-rd-toolkit-mac" release from main:
# macOS DatumBench-macOS-AppleSilicon.dmg + DatumBench-macOS-Intel.dmg
# The apps are thin native windows around the live site, so every push to the site reaches them through GitHub
# Pages without a rebuild. This workflow only runs when the shell in desktop/ changes. Every build is opened and
# checked on its own system first; only builds that passed are published, and the download links never change.
on:
push:
branches: [main]
paths:
- 'apps/me-rd-toolkit/shell/desktop/**'
- '.github/workflows/me-rd-toolkit-mac.yml'
pull_request:
paths:
- 'apps/me-rd-toolkit/shell/desktop/**'
- '.github/workflows/me-rd-toolkit-mac.yml'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: me-rd-toolkit-mac-${{ github.ref }}
cancel-in-progress: true

jobs:
desktop:
name: Desktop (${{ matrix.name }})
strategy:
fail-fast: false
matrix:
include:
- name: macOS Apple silicon
os: macos-15
- name: macOS Intel
os: macos-15-intel
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install PyInstaller, Pillow and pywebview
run: python -m pip install --disable-pip-version-check pyinstaller pillow pywebview
- name: Install Inno Setup
if: runner.os == 'Windows'
shell: pwsh
run: |
$iscc = Join-Path ${env:ProgramFiles(x86)} 'Inno Setup 6\ISCC.exe'
if (-not (Test-Path $iscc) -and -not (Get-Command iscc -ErrorAction SilentlyContinue)) {
choco install innosetup --no-progress -y
}
- name: Make sure the WebView2 runtime is there (the Windows window uses it)
if: runner.os == 'Windows'
shell: pwsh
run: |
$client = '{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}'
$keys = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\$client",
"HKCU:\Software\Microsoft\EdgeUpdate\Clients\$client"
$version = $keys | Where-Object { Test-Path $_ } | ForEach-Object { (Get-ItemProperty $_).pv } |
Where-Object { $_ -and $_ -ne '0.0.0.0' } | Select-Object -First 1
if ($version) { Write-Host "WebView2 runtime $version"; exit 0 }
$setup = Join-Path $env:RUNNER_TEMP 'MicrosoftEdgeWebview2Setup.exe'
Invoke-WebRequest 'https://go.microsoft.com/fwlink/p/?LinkId=2124703' -OutFile $setup
Start-Process -FilePath $setup -ArgumentList '/silent', '/install' -Wait
- name: Stop XProtect scans (they make hdiutil fail with "Resource busy")
if: runner.os == 'macOS'
run: |
sudo pkill -9 XProtect > /dev/null 2>&1 || true
for attempt in $(seq 1 20); do pgrep -x XProtect > /dev/null || break; sleep 3; done
- name: Build and package
run: python apps/me-rd-toolkit/shell/desktop/build.py --require-installer
- name: Open the built app and check its window shows this commit's DatumBench
run: python apps/me-rd-toolkit/shell/desktop/smoke_test.py --built --local-site
- name: Install with DatumBench-Windows-Setup.exe, run it, uninstall it
if: runner.os == 'Windows'
shell: pwsh
run: |
$setup = Resolve-Path 'apps/me-rd-toolkit/shell/desktop/dist/DatumBench-Windows-Setup.exe'
$log = Join-Path $env:RUNNER_TEMP 'merdtoolkit-setup.log'
$process = Start-Process -FilePath $setup -Wait -PassThru -ArgumentList @(
'/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART', '/TASKS=desktopicon', "/LOG=$log")
if ($process.ExitCode -ne 0) { Get-Content $log -Tail 40; throw "Setup failed with exit code $($process.ExitCode)" }
$app = Join-Path $env:LOCALAPPDATA 'Programs\DatumBench\DatumBench.exe'
if (-not (Test-Path $app)) { throw "DatumBench.exe was not installed to $app" }
$shortcuts = @(
(Join-Path ([Environment]::GetFolderPath('Programs')) 'DatumBench.lnk'),
(Join-Path ([Environment]::GetFolderPath('Desktop')) 'DatumBench.lnk'))
foreach ($link in $shortcuts) { if (-not (Test-Path $link)) { throw "Missing shortcut: $link" } }
$entry = Get-ChildItem 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall' |
Get-ItemProperty | Where-Object DisplayName -eq 'DatumBench'
if (-not $entry) { throw 'DatumBench is missing from Settings > Apps' }
python apps/me-rd-toolkit/shell/desktop/smoke_test.py --local-site $app
if ($LASTEXITCODE -ne 0) { throw 'The installed app failed its checks' }
Start-Process -FilePath $entry.UninstallString.Trim('"') -Wait -ArgumentList '/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART'
for ($i = 0; $i -lt 60 -and (Test-Path $app); $i++) { Start-Sleep -Seconds 1 }
if (Test-Path $app) { throw 'Uninstalling left DatumBench.exe behind' }
foreach ($link in $shortcuts) { if (Test-Path $link) { throw "Uninstalling left a shortcut: $link" } }
Write-Host 'Installed, ran and uninstalled cleanly'
- name: Check the Mac app and disk image
if: runner.os == 'macOS'
run: |
APP=apps/me-rd-toolkit/shell/desktop/dist/DatumBench.app
test "$(plutil -extract CFBundleIdentifier raw "$APP/Contents/Info.plist")" = "io.github.juw12.merdtoolkit.desktop"
test "$(plutil -extract CFBundleShortVersionString raw "$APP/Contents/Info.plist")" = "$(python3 -c 'import json; print(json.load(open("apps/me-rd-toolkit/shell/desktop/shell.json"))["version"])')"
echo "Architecture: $(lipo -archs "$APP/Contents/MacOS/DatumBench")"
codesign --verify --deep --verbose=2 "$APP"
for image in apps/me-rd-toolkit/shell/desktop/dist/*.dmg; do hdiutil verify "$image"; done
- uses: actions/upload-artifact@v4
with:
name: DatumBench-${{ runner.os }}-${{ runner.arch }}
path: apps/me-rd-toolkit/shell/desktop/dist/DatumBench-*
if-no-files-found: error
retention-days: 14

publish:
needs: [desktop]
if: ${{ !cancelled() && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: DatumBench-*
path: dist
merge-multiple: true
- name: Publish the apps to the apps release
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
run: |
cd dist
FILES=""
for name in DatumBench-macOS-AppleSilicon.dmg DatumBench-macOS-Intel.dmg; do
if [ -f "$name" ]; then
FILES="$FILES $name"
else
echo "::warning::$name was not built in this run; the release keeps its previous copy (if any)."
fi
done
if [ -z "$FILES" ]; then
echo "::error::No app passed its checks."
exit 1
fi
sha256sum $FILES > SHA256SUMS.txt
cat SHA256SUMS.txt
cat > notes.md <<'EOF'
**Datum Bench**: mechanical RandD checklists. The apps open the same Datum Bench as https://juw12.github.io/projects/me-rd-toolkit/ in their own window.

| Your device | Download | How to install |
| --- | --- | --- |
| **Mac with Apple chip (M1 and newer)** | [DatumBench-macOS-AppleSilicon.dmg](https://github.com/juw12/projects/releases/download/me-rd-toolkit-mac/DatumBench-macOS-AppleSilicon.dmg) | Open it and drag DatumBench to Applications. The first time, macOS blocks it because it is not notarized: **System Settings → Privacy & Security → Open Anyway**. |
| **Mac with Intel chip** | [DatumBench-macOS-Intel.dmg](https://github.com/juw12/projects/releases/download/me-rd-toolkit-mac/DatumBench-macOS-Intel.dmg) | Same as above. Not sure which Mac? Apple menu → About This Mac shows **Chip** (Apple) or **Processor** (Intel). |
| **iPhone / iPad** | [Open in Safari](https://juw12.github.io/projects/me-rd-toolkit/) | Share → **Add to Home Screen** (free, full screen, updates itself). |
| **Android** | [DatumBench-android.apk](https://github.com/juw12/projects/releases/download/me-rd-toolkit-android/DatumBench-android.apk) | Open the file on the phone and allow your browser to install apps once. |

The apps load DatumBench from the web, so new versions arrive the moment they are published, with no reinstall. Checksums for this build: `SHA256SUMS.txt`.
EOF
{
echo
echo "Built from ${GITHUB_SHA::7}."
} >> notes.md
if gh release view me-rd-toolkit-mac --repo "$REPO" > /dev/null 2>&1; then
gh release upload me-rd-toolkit-mac $FILES SHA256SUMS.txt --clobber --repo "$REPO"
gh release edit me-rd-toolkit-mac --notes-file notes.md --repo "$REPO"
else
gh release create me-rd-toolkit-mac $FILES SHA256SUMS.txt --title "Datum Bench for Mac" \
--notes-file notes.md --latest=false --repo "$REPO"
fi
6 changes: 6 additions & 0 deletions apps/fade/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ shorts, DMs and payment records live on public decentralised infrastructure
(Nostr relays, Blossom media servers, ntfy push). Money moves directly between
people with the payment apps they already use. Fade takes 0% and never holds funds.

## On a Mac

- **Mac:** [`Fade-macOS-AppleSilicon.dmg`](https://github.com/juw12/projects/releases/download/fade-mac/Fade-macOS-AppleSilicon.dmg) (M1 and newer) or [`Fade-macOS-Intel.dmg`](https://github.com/juw12/projects/releases/download/fade-mac/Fade-macOS-Intel.dmg). Open it and drag Fade to Applications. The first time, macOS blocks it because it is not notarized: **System Settings → Privacy & Security → Open Anyway**.

It is the web edition (https://juw12.github.io/projects/fade/) in its own window ([`desktop/`](shell/desktop/README.md)) and changes with it. Each build is opened on an Apple-silicon Mac and an Intel Mac on GitHub before it is published: the page loads, the app starts and can store data. No Mac of ours has run it yet.

## On an Android phone

- **Android:** [`Fade-android.apk`](https://github.com/juw12/projects/releases/download/fade-android/Fade-android.apk): open the file on the phone and allow your browser to install apps once.
Expand Down
3 changes: 3 additions & 0 deletions apps/fade/shell/desktop/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/
dist/
__pycache__/
Loading
Loading