(feat): migrate experimental tauri cef to electron
Some checks failed
/ build-web (push) Successful in 1m19s
/ build-desktop (linux) (push) Failing after 2m33s
/ release (push) Has been cancelled
/ build-mobile (push) Has been cancelled

(feat): add flake to expose tensamin desktop package
(qol): update todo
This commit is contained in:
Alois 2026-05-25 13:16:56 +02:00
commit a209ade10b
32 changed files with 1649 additions and 459 deletions

View file

@ -2,6 +2,8 @@ on:
push:
branches:
- main
paths-ignore:
- flake.nix
jobs:
build-web:
@ -11,7 +13,7 @@ jobs:
uses: https://data.forgejo.org/actions/checkout@v4
- name: Install Packages
run: apt-get update && apt-get install -y sudo curl jq
run: apt-get update && apt-get install -y sudo curl jq fakeroot dpkg rpm
- name: Install Nix
uses: https://github.com/cachix/install-nix-action@v30
@ -44,7 +46,7 @@ jobs:
uses: https://data.forgejo.org/actions/checkout@v4
- name: Install Packages
run: apt-get update && apt-get install -y sudo curl jq
run: apt-get update && apt-get install -y sudo curl jq fakeroot dpkg rpm
- name: Install Nix
uses: https://github.com/cachix/install-nix-action@v30
@ -80,6 +82,9 @@ jobs:
build-desktop:
runs-on: docker
strategy:
matrix:
target: [linux]
steps:
- name: Check out repo
uses: https://data.forgejo.org/actions/checkout@v4
@ -87,9 +92,6 @@ jobs:
- name: Install Packages
run: apt-get update && apt-get install -y sudo curl jq
- name: Install Nix
uses: https://github.com/cachix/install-nix-action@v30
- name: Install Bun
uses: oven-sh/setup-bun@v2
@ -102,14 +104,14 @@ jobs:
- name: Build packages
run: bun run build:packages
- name: Build desktop
- name: Build Electron desktop
run: bun run build:desktop
- name: Upload desktop artifacts
uses: https://data.forgejo.org/actions/upload-artifact@v3
with:
name: desktop-bundles
path: apps/tauri/src-tauri/target/release/bundle/
name: electron-desktop-${{ matrix.target }}
path: apps/electron/release/
release:
runs-on: docker
@ -136,8 +138,8 @@ jobs:
- name: Download desktop artifacts
uses: https://data.forgejo.org/actions/download-artifact@v3
with:
name: desktop-bundles
path: apps/tauri/src-tauri/target/release/bundle/
name: electron-desktop-linux
path: apps/electron/release/
- name: Copy releases
run: bun --bun run copy-releases
@ -190,9 +192,53 @@ jobs:
}')")"
RELEASE_ID="$(echo "$RELEASE_JSON" | jq -r .id)"
ASSET_BASE_URL="${API%/api/v1}/$REPO/releases/download/$TAG"
export ASSET_BASE_URL
node -e '
const fs = require("fs");
const path = "releases/electron-release-metadata.json";
const metadata = JSON.parse(fs.readFileSync(path, "utf8"));
metadata.tag = process.env.TAG;
for (const artifact of metadata.artifacts || []) {
artifact.url = `${process.env.ASSET_BASE_URL}/${encodeURIComponent(artifact.name)}`;
}
fs.writeFileSync(path, `${JSON.stringify(metadata, null, 2)}\n`);
'
find releases -type f -print0 | while IFS= read -r -d '' file; do
name="$(basename "$file")"
curl -fsS -X POST "$API/repos/$REPO/releases/$RELEASE_ID/assets?name=$name" \
-H "Authorization: token $TOKEN" \
-F "attachment=@$file"
done
- name: Update root flake release hash
env:
TAG: ${{ steps.version.outputs.tag }}
run: |
set -eu
APPIMAGE="$(find releases -maxdepth 1 -type f -name 'Tensamin-*-linux-x86_64.AppImage' -print -quit)"
test -n "$APPIMAGE"
HASH="$(node -e 'const fs = require("fs"); const crypto = require("crypto"); const file = process.argv[1]; console.log("sha256-" + crypto.createHash("sha256").update(fs.readFileSync(file)).digest("base64"));' "$APPIMAGE")"
export HASH
node -e '
const fs = require("fs");
const version = process.env.TAG;
const hash = process.env.HASH;
let content = fs.readFileSync("flake.nix", "utf8");
content = content.replace(/version = "[^"]+";/, `version = "${version}";`);
content = content.replace(/hash = "sha256-[^"]+";/, `hash = "${hash}";`);
fs.writeFileSync("flake.nix", content);
'
if git diff --quiet -- flake.nix; then
echo "flake.nix already has the current release hash."
exit 0
fi
git add flake.nix
git -c user.name="forgejo-actions" -c user.email="forgejo-actions@localhost" commit -m "(qol): update release flake hash"
git push