Compare commits

..
Author SHA1 Message Date
dbd685bd43 (feat): add cleanup for workflow runs and releases
All checks were successful
/ build-web (push) Successful in 3m6s
/ build-desktop (linux) (push) Successful in 8m3s
/ build-mobile (push) Successful in 23m13s
/ release (push) Successful in 52s
2026-05-29 10:37:18 +02:00
4445852c42 (feat): add icons to the electron app
All checks were successful
/ build-web (push) Successful in 3m55s
/ build-desktop (linux) (push) Successful in 9m5s
/ build-mobile (push) Successful in 25m54s
/ release (push) Successful in 28s
(feat): bump version
2026-05-28 20:16:40 +02:00
forgejo-actions
b5e7b8e2c1 (qol): update release flake hash 2026-05-28 14:09:24 +00:00
17 changed files with 139 additions and 6 deletions

View file

@ -0,0 +1,56 @@
on:
workflow_dispatch:
schedule:
- cron: "30 3 * * *"
jobs:
cleanup-workflow-runs:
runs-on: docker
steps:
- name: Install Packages
run: apt-get update && apt-get install -y curl jq
- name: Delete workflow runs older than 14 days
env:
TOKEN: ${{ forgejo.token }}
API: ${{ forgejo.api_url }}
REPO: ${{ forgejo.repository }}
CURRENT_RUN_ID: ${{ forgejo.run_id }}
run: |
set -eu
CUTOFF="$(date -u -d "14 days ago" +"%Y-%m-%dT%H:%M:%SZ")"
PAGE=1
DELETE_IDS=delete-workflow-runs.txt
: > "$DELETE_IDS"
while :; do
curl -fsS \
-H "Authorization: token $TOKEN" \
"$API/repos/$REPO/actions/runs?page=$PAGE&limit=50" \
-o runs.json
COUNT="$(jq '.workflow_runs | length' runs.json)"
test "$COUNT" -gt 0 || break
jq -r \
--arg cutoff "$CUTOFF" \
--arg current "$CURRENT_RUN_ID" \
'.workflow_runs[]
| select((.id | tostring) != $current)
| select(["success", "failure", "cancelled", "skipped", "succeeded", "failed"] | index(.status))
| select(.created < $cutoff)
| .id' runs.json \
>> "$DELETE_IDS"
PAGE="$((PAGE + 1))"
done
while IFS= read -r run_id; do
test -n "$run_id" || continue
echo "Deleting workflow run $run_id"
curl -fsS -X DELETE \
-H "Authorization: token $TOKEN" \
"$API/repos/$REPO/actions/runs/$run_id"
done < "$DELETE_IDS"

View file

@ -232,6 +232,46 @@ jobs:
-F "attachment=@$file" -F "attachment=@$file"
done done
- name: Delete dev releases for prod version
env:
TOKEN: ${{ forgejo.token }}
API: ${{ forgejo.api_url }}
REPO: ${{ forgejo.repository }}
TAG: ${{ steps.version.outputs.tag }}
run: |
set -eu
PAGE=1
PREFIX="$TAG-dev-"
DELETE_RELEASES=delete-dev-releases.tsv
: > "$DELETE_RELEASES"
while :; do
curl -fsS \
-H "Authorization: token $TOKEN" \
"$API/repos/$REPO/releases?page=$PAGE&limit=50&pre-release=true" \
-o releases.json
COUNT="$(jq 'length' releases.json)"
test "$COUNT" -gt 0 || break
jq -r \
--arg prefix "$PREFIX" \
'.[] | select(.prerelease == true) | select(.tag_name | startswith($prefix)) | [.id, .tag_name] | @tsv' releases.json \
>> "$DELETE_RELEASES"
PAGE="$((PAGE + 1))"
done
while IFS="$(printf '\t')" read -r release_id release_tag; do
test -n "$release_id" || continue
echo "Deleting dev release $release_tag"
curl -fsS -X DELETE \
-H "Authorization: token $TOKEN" \
"$API/repos/$REPO/releases/$release_id"
done < "$DELETE_RELEASES"
- name: Update root flake release hash - name: Update root flake release hash
env: env:
TAG: ${{ steps.version.outputs.tag }} TAG: ${{ steps.version.outputs.tag }}

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View file

@ -41,6 +41,7 @@
"productName": "Tensamin", "productName": "Tensamin",
"executableName": "tensamin", "executableName": "tensamin",
"artifactName": "Tensamin-${version}-${os}-${arch}.${ext}", "artifactName": "Tensamin-${version}-${os}-${arch}.${ext}",
"icon": "build/icons/icon.png",
"directories": { "directories": {
"output": "release" "output": "release"
}, },
@ -52,10 +53,15 @@
{ {
"from": "../web/dist", "from": "../web/dist",
"to": "web" "to": "web"
},
{
"from": "build/icons/icon.png",
"to": "icons/icon.png"
} }
], ],
"linux": { "linux": {
"target": ["AppImage", "deb", "rpm"], "target": ["AppImage", "deb", "rpm"],
"icon": "build/icons",
"executableName": "tensamin", "executableName": "tensamin",
"category": "Network", "category": "Network",
"maintainer": "Methanium", "maintainer": "Methanium",
@ -67,10 +73,12 @@
} }
}, },
"win": { "win": {
"target": ["nsis", "portable"] "target": ["nsis", "portable"],
"icon": "build/icons/icon.ico"
}, },
"mac": { "mac": {
"target": ["dmg"] "target": ["dmg"],
"icon": "build/icons/icon.icns"
}, },
"publish": null "publish": null
} }

View file

@ -34,6 +34,12 @@ function getRendererIndex() {
return join(process.resourcesPath, "web", "index.html"); return join(process.resourcesPath, "web", "index.html");
} }
function getWindowIcon() {
if (process.platform === "darwin") return undefined;
if (app.isPackaged) return join(process.resourcesPath, "icons", "icon.png");
return resolve(__dirname, "../../build/icons/icon.png");
}
function getPlatform(): DesktopScreenShareCapabilities["platform"] { function getPlatform(): DesktopScreenShareCapabilities["platform"] {
if (process.platform === "linux") return "linux"; if (process.platform === "linux") return "linux";
if (process.platform === "darwin") return "macos"; if (process.platform === "darwin") return "macos";
@ -191,6 +197,7 @@ async function createWindow() {
minWidth: 900, minWidth: 900,
minHeight: 600, minHeight: 600,
title: "Tensamin", title: "Tensamin",
icon: getWindowIcon(),
frame: false, frame: false,
autoHideMenuBar: true, autoHideMenuBar: true,
webPreferences: { webPreferences: {

View file

@ -22,7 +22,7 @@
"build:mobile:raw": "tauri android build", "build:mobile:raw": "tauri android build",
"dev:mobile": "if command -v nix >/dev/null 2>&1; then nix develop --command bun dev:mobile:raw; else bun dev:mobile:raw; fi", "dev:mobile": "if command -v nix >/dev/null 2>&1; then nix develop --command bun dev:mobile:raw; else bun dev:mobile:raw; fi",
"build:mobile": "bun run render-version.ts && if command -v nix >/dev/null 2>&1; then nix develop --command bun build:mobile:raw; else bun build:mobile:raw; fi && bun run render-version.ts --unrender", "build:mobile": "bun run render-version.ts && if command -v nix >/dev/null 2>&1; then nix develop --command bun build:mobile:raw; else bun build:mobile:raw; fi && bun run render-version.ts --unrender",
"gen-icons": "tauri icon ./logo.json", "gen-icons": "tauri icon ./logo.json && bun scripts/sync-electron-icons.ts",
"format": "bunx prettier --write .", "format": "bunx prettier --write .",
"lint": "eslint src" "lint": "eslint src"
}, },

View file

@ -0,0 +1,19 @@
import { copyFile, mkdir } from "node:fs/promises";
import { dirname, join, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const scriptDir = dirname(fileURLToPath(import.meta.url));
const tauriDir = resolve(scriptDir, "..");
const clientDir = resolve(tauriDir, "../..");
const tauriIconsDir = join(tauriDir, "src-tauri", "icons");
const electronIconsDir = join(clientDir, "apps", "electron", "build", "icons");
const desktopIcons = ["32x32.png", "64x64.png", "128x128.png", "128x128@2x.png", "icon.png", "icon.ico", "icon.icns"];
await mkdir(electronIconsDir, { recursive: true });
await Promise.all(
desktopIcons.map((icon) => copyFile(join(tauriIconsDir, icon), join(electronIconsDir, icon))),
);
console.log(`Synced ${desktopIcons.length} desktop icons to ${electronIconsDir}`);

Binary file not shown.

View file

@ -6,8 +6,8 @@
outputs = {nixpkgs, ...}: let outputs = {nixpkgs, ...}: let
systems = ["x86_64-linux"]; systems = ["x86_64-linux"];
forAllSystems = nixpkgs.lib.genAttrs systems; forAllSystems = nixpkgs.lib.genAttrs systems;
version = "0.0.5"; version = "0.0.6";
x86_64DebHash = "sha256-flC62rhhKyE/yRoNZRwXVHn/vwxE/Klxzj8uWhItDkY="; x86_64DebHash = "sha256-rNlyNZFgYVRvJzX1sBz/qLHUdZoyfvHl5xuwb2BtU48=";
forgejoBaseUrl = "https://git.methanium.net/tensamin/client/releases/download/${version}"; forgejoBaseUrl = "https://git.methanium.net/tensamin/client/releases/download/${version}";
in { in {
packages = forAllSystems (system: let packages = forAllSystems (system: let

View file

@ -1,6 +1,6 @@
{ {
"name": "tensamin", "name": "tensamin",
"version": "0.0.6", "version": "0.0.7",
"private": true, "private": true,
"workspaces": [ "workspaces": [
"packages/*", "packages/*",

3
readme.md Normal file
View file

@ -0,0 +1,3 @@
# Information
All dev releases between two prod version get deleted upon creation of the latest prod release.