From 372dd7123ad9a3de5595ee987425c6de1d566f21 Mon Sep 17 00:00:00 2001 From: Vassiliy Yegorov Date: Mon, 15 Jun 2026 16:52:24 +0700 Subject: [PATCH] Update version to 0.1.6 Add Gitea package registry support Add publish-dmg target for versioned DMG uploads Update deploy-dmg to include Gitea publishing Document Gitea token requirements in README --- Cargo.lock | 10 +++++----- Cargo.toml | 2 +- Makefile | 26 +++++++++++++++++++++++++- app/src-tauri/Cargo.lock | 2 +- app/src-tauri/tauri.conf.json | 2 +- deploy/README.md | 12 ++++++++++++ 6 files changed, 45 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0110835..9177bcd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -869,7 +869,7 @@ dependencies = [ [[package]] name = "spacesh-cli" -version = "0.1.3" +version = "0.1.6" dependencies = [ "anyhow", "clap", @@ -881,7 +881,7 @@ dependencies = [ [[package]] name = "spacesh-core" -version = "0.1.3" +version = "0.1.6" dependencies = [ "alacritty_terminal", "serde", @@ -891,7 +891,7 @@ dependencies = [ [[package]] name = "spacesh-proto" -version = "0.1.3" +version = "0.1.6" dependencies = [ "bytes", "serde", @@ -903,7 +903,7 @@ dependencies = [ [[package]] name = "spacesh-pty" -version = "0.1.3" +version = "0.1.6" dependencies = [ "anyhow", "bytes", @@ -913,7 +913,7 @@ dependencies = [ [[package]] name = "spaceshd" -version = "0.1.3" +version = "0.1.6" dependencies = [ "anyhow", "base64", diff --git a/Cargo.toml b/Cargo.toml index 5cfa664..d0d9831 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ members = [ [workspace.package] edition = "2021" -version = "0.1.3" +version = "0.1.6" [workspace.dependencies] tokio = { version = "1", features = ["full"] } diff --git a/Makefile b/Makefile index a6be9dc..99d060c 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,12 @@ LANDING_VERSION := $(shell cat landing/VERSION 2>/dev/null || echo 0.0.0) REGISTRY ?= git.realmanual.ru REPO ?= spacesh +# ---- Gitea generic package registry (versioned .dmg downloads) ---- +GITEA_URL ?= https://git.realmanual.ru +GITEA_OWNER ?= realmanual +GITEA_PKG ?= spacesh +GITEA_TOKEN ?= # token with package:write; pass via env/CLI, never commit + # ---- Prod deploy (SSH) ---- SSH_HOST ?= 192.168.8.5 SSH_USER ?= root @@ -134,7 +140,7 @@ landing-push: landing-image ## tag & push the landing image to the registry # ---- Prod deploy ---- .PHONY: deploy-dmg -deploy-dmg: dmg ## upload the .dmg + update manifest (latest.json) to the prod download dir +deploy-dmg: dmg ## upload .dmg + manifest to prod, and publish the versioned .dmg to Gitea Packages @VER=$$(node -p "require('./$(APP_DIR)/src-tauri/tauri.conf.json').version"); \ printf '{"version":"%s","url":"https://spaceshell.ru/download/spacesh.dmg"}\n' "$$VER" > /tmp/spacesh-latest.json; \ echo "manifest version → $$VER" @@ -142,6 +148,24 @@ deploy-dmg: dmg ## upload the .dmg + update manifest (latest.json) to the prod d scp $(SSH_OPTS) $(DMG_DIR)/*.dmg "$(SSH_USER)@$(SSH_HOST):$(SSH_REMOTE_DIR)/download/spacesh.dmg" scp $(SSH_OPTS) /tmp/spacesh-latest.json "$(SSH_USER)@$(SSH_HOST):$(SSH_REMOTE_DIR)/download/latest.json" @echo "Uploaded → https://spaceshell.ru/download/spacesh.dmg + latest.json" + @$(MAKE) --no-print-directory _publish-dmg + +.PHONY: publish-dmg +publish-dmg: dmg _publish-dmg ## build + publish the versioned .dmg to the Gitea package registry + +# Internal: upload the most recently built .dmg to Gitea's generic registry under +# the current version. No build dependency, so deploy-dmg can call it without a +# second bump/rebuild. Skips (doesn't fail) when GITEA_TOKEN is unset. +.PHONY: _publish-dmg +_publish-dmg: + @if [ -z "$(GITEA_TOKEN)" ]; then echo "GITEA_TOKEN unset — skipping Gitea Packages publish"; exit 0; fi; \ + VER=$$(node -p "require('./$(APP_DIR)/src-tauri/tauri.conf.json').version"); \ + DMG=$$(ls -t $(DMG_DIR)/*.dmg 2>/dev/null | head -1); \ + if [ -z "$$DMG" ]; then echo "no .dmg in $(DMG_DIR) — run make dmg first"; exit 1; fi; \ + URL="$(GITEA_URL)/api/packages/$(GITEA_OWNER)/generic/$(GITEA_PKG)/$$VER/spacesh-$$VER.dmg"; \ + echo "Publishing $$DMG → $$URL"; \ + curl --fail-with-body -sS -H "Authorization: token $(GITEA_TOKEN)" --upload-file "$$DMG" "$$URL" && \ + echo "Published spacesh-$$VER.dmg to Gitea Packages ($(GITEA_OWNER)/$(GITEA_PKG)@$$VER)" .PHONY: deploy-stack deploy-stack: ## sync compose+proxy.conf to prod and pull/up (manual; CI does this on push) diff --git a/app/src-tauri/Cargo.lock b/app/src-tauri/Cargo.lock index 6f38403..00ea400 100644 --- a/app/src-tauri/Cargo.lock +++ b/app/src-tauri/Cargo.lock @@ -3440,7 +3440,7 @@ dependencies = [ [[package]] name = "spacesh-proto" -version = "0.1.3" +version = "0.1.6" dependencies = [ "bytes", "serde", diff --git a/app/src-tauri/tauri.conf.json b/app/src-tauri/tauri.conf.json index 5a5b825..cb86fbf 100644 --- a/app/src-tauri/tauri.conf.json +++ b/app/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "spacesh", - "version": "0.1.3", + "version": "0.1.6", "identifier": "xyz.spacesh.app", "build": { "frontendDist": "../dist", diff --git a/deploy/README.md b/deploy/README.md index 0ba2aa9..36f795c 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -25,6 +25,18 @@ mkdir -p $SSH_REMOTE_DIR/download server, then `docker compose pull && up -d`. - **DMG** → built on macOS, uploaded by hand: `make deploy-dmg` (sets the stable `download/spacesh.dmg`). Tauri can't build a macOS bundle in CI. + The same command also publishes a **versioned** copy to the Gitea package + registry (`Packages` tab) when `GITEA_TOKEN` is set: + + ```bash + GITEA_TOKEN= make deploy-dmg # server + Gitea Packages + make publish-dmg GITEA_TOKEN= # build + Gitea Packages only + ``` + + Published at `{GITEA_URL}/api/packages/{GITEA_OWNER}/generic/spacesh//spacesh-.dmg` + (override `GITEA_URL`/`GITEA_OWNER`/`GITEA_PKG` if needed). Version comes from + `tauri.conf.json`, bumped on every `make dmg`. Without `GITEA_TOKEN` the publish + step is skipped (server copy still happens). ## Gitea secrets required