From 410c949b87424b4ac0df5e3f38930781c6eda147 Mon Sep 17 00:00:00 2001 From: 苏向夜 Date: Fri, 23 Jan 2026 20:56:19 +0800 Subject: feat(client): add tauri api macros --- .changes/config.toml | 5 +++++ 1 file changed, 5 insertions(+) (limited to '.changes/config.toml') diff --git a/.changes/config.toml b/.changes/config.toml index dbce913..8a7034d 100644 --- a/.changes/config.toml +++ b/.changes/config.toml @@ -20,6 +20,11 @@ resolver = "rust" version-mode = { pre-release.tag = "alpha" } assets = ["artifacts/**/*"] +[packages.dropout-macros] +path = "crates/macros" +resolver = "rust" +version-mode = { pre-release.tag = "alpha" } + [resolver.rust.pre-check] url = "https://crates.io/api/v1/crates/{{ package.name }}/{{ package.version }}" -- cgit v1.2.3-70-g09d2 From 8ff3af6cb908fd824b512379dd21ed4f595ab6bb Mon Sep 17 00:00:00 2001 From: 苏向夜 Date: Wed, 25 Feb 2026 02:04:39 +0800 Subject: chore(ci): release to aur --- .changes/config.toml | 12 ++- .github/workflows/semifold-ci.yaml | 1 + .gitignore | 3 + scripts/release-aur.ts | 152 +++++++++++++++++++++++++++++++++++++ 4 files changed, 164 insertions(+), 4 deletions(-) create mode 100644 scripts/release-aur.ts (limited to '.changes/config.toml') diff --git a/.changes/config.toml b/.changes/config.toml index dbce913..fa6ca47 100644 --- a/.changes/config.toml +++ b/.changes/config.toml @@ -30,6 +30,10 @@ User-Agent = "Semifold 0.2.10" command = "cargo" args = ["publish"] +[[resolver.rust.publish]] +command = "pnpm" +args = ["tsx", "scripts/release-aur.ts"] + [[resolver.rust.post-version]] command = "pnpm" args = ["bump-tauri"] @@ -40,8 +44,8 @@ url = "https://registry.npmjs.org/{{ package.name }}/{{ package.version }}" [[resolver.nodejs.publish]] command = "npm" args = [ - "publish", - "--provenance", - "--access", - "public", + "publish", + "--provenance", + "--access", + "public", ] diff --git a/.github/workflows/semifold-ci.yaml b/.github/workflows/semifold-ci.yaml index 27de130..aad64ab 100644 --- a/.github/workflows/semifold-ci.yaml +++ b/.github/workflows/semifold-ci.yaml @@ -7,6 +7,7 @@ env: CARGO_TERM_COLOR: always CLICOLOR_FORCE: 1 CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }} + AUR_SSH_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }} permissions: id-token: write diff --git a/.gitignore b/.gitignore index b3a0dbf..5d6d0f3 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,6 @@ __pycache__/ # Tauri artifacts artifacts/ + +# AUR Release +release/ diff --git a/scripts/release-aur.ts b/scripts/release-aur.ts new file mode 100644 index 0000000..d1fed87 --- /dev/null +++ b/scripts/release-aur.ts @@ -0,0 +1,152 @@ +import { execSync } from "node:child_process"; +import { + existsSync, + mkdirSync, + readFileSync, + unlinkSync, + writeFileSync, +} from "node:fs"; +import path from "node:path"; +import { version as pkgver } from "../src-tauri/tauri.conf.json"; + +function getSHA256Sum(url: string) { + const response = execSync(`curl -L ${url} | sha256sum`); + return response.toString().split(" ")[0]; +} + +execSync("mkdir -p release", { stdio: "inherit" }); +process.chdir("release"); + +const basePath = process.cwd(); +const homePath = process.env.HOME ?? basePath; +const sshPath = path.resolve(homePath, ".ssh"); +if (!existsSync(sshPath)) { + mkdirSync(sshPath, { recursive: true }); +} + +const url = "https://github.com/HydroRoll-Team/DropOut"; +const x86_64Url = `${url}/releases/download/dropout-v${pkgver}/dropout_${pkgver}_amd64.deb`; +const aarch64Url = `${url}/releases/download/dropout-v${pkgver}/dropout_${pkgver}_arm64.deb`; +const PKGBUILD = `\ +# Maintainer: HsiangNianian +# Contributor: 苏向夜 +pkgname=dropout-bin +pkgver=${pkgver} +pkgrel=1 +pkgdesc="A modern, reproducible, and developer-grade Minecraft launcher" +arch=('x86_64' 'aarch64') +url="${url}" +license=('MIT') +depends=('cairo' 'desktop-file-utils' 'gdk-pixbuf2' 'glib2' 'gtk3' 'hicolor-icon-theme' 'libsoup' 'pango' 'webkit2gtk-4.1') +options=('!strip' '!debug') +install=dropout-bin.install +source_x86_64=("${x86_64Url}") +source_aarch64=("${aarch64Url}") +sha256sums_x86_64=('${getSHA256Sum(x86_64Url)}') +sha256sums_aarch64=('${getSHA256Sum(aarch64Url)}') +package() { + # Extract package data + tar -xvf data.tar.gz -C "\${pkgdir}" +} +`; +const INSTALL = `\ +post_install() { + gtk-update-icon-cache -q -t -f usr/share/icons/hicolor + update-desktop-database -q +} + +post_upgrade() { + post_install +} + +post_remove() { + gtk-update-icon-cache -q -t -f usr/share/icons/hicolor + update-desktop-database -q +}`; + +// Check if AUR_SSH_KEY environment variable is set +const AUR_SSH_KEY = process.env.AUR_SSH_KEY; +if (!AUR_SSH_KEY) { + console.error("AUR_SSH_KEY environment variable is not set."); + process.exit(1); +} + +// Remove old SSH key file if it exists +const aurSSHKeyPath = path.resolve(sshPath, "aur"); +if (existsSync(aurSSHKeyPath)) { + unlinkSync(aurSSHKeyPath); +} + +// Write new SSH key file +writeFileSync(aurSSHKeyPath, `${AUR_SSH_KEY}\n`); +execSync(`chmod 400 ${aurSSHKeyPath}`); + +// Add aur to known hosts +const knownHostsPath = path.resolve(sshPath, "known_hosts"); +if (existsSync(knownHostsPath)) { + const knownHosts = readFileSync(knownHostsPath, { + encoding: "utf-8", + }); + if (!knownHosts.includes("aur.archlinux.org")) { + execSync( + `ssh-keyscan -v -t "rsa,ecdsa,ed25519" aur.archlinux.org >> ~/.ssh/known_hosts`, + { stdio: "inherit" }, + ); + } +} else { + execSync( + `ssh-keyscan -v -t "rsa,ecdsa,ed25519" aur.archlinux.org > ~/.ssh/known_hosts`, + { stdio: "inherit" }, + ); +} + +// Clone AUR repository if not exists +if (!existsSync("aur")) { + execSync( + `git -c init.defaultBranch=master -c core.sshCommand="ssh -i ${aurSSHKeyPath}" clone ssh://aur@aur.archlinux.org/clip-bridge-bin.git aur`, + { stdio: "inherit" }, + ); +} +execSync(`git -C aur config core.sshCommand "ssh -i ${aurSSHKeyPath}"`, { + stdio: "inherit", +}); + +// Write PKGBUILD and .install files +const pkgbuildPath = path.resolve("aur", "PKGBUILD"); +const installPath = path.resolve("aur", "dropout-bin.install"); +writeFileSync(pkgbuildPath, PKGBUILD); +writeFileSync(installPath, INSTALL); + +// Generate .SRCINFO file +execSync("makepkg --printsrcinfo > .SRCINFO", { + cwd: "aur", + stdio: "inherit", +}); + +// Setup Git repository +execSync("git add PKGBUILD .SRCINFO", { + stdio: "inherit", + cwd: "aur", +}); +execSync(`git -C aur config user.name "HsiangNianian"`, { stdio: "inherit" }); +execSync(`git -C aur config user.email "i@jyunko.cn"`, { + stdio: "inherit", +}); + +// Test AUR package (skip in CI) +if (!process.env.CI) { + execSync("makepkg -f", { + stdio: "inherit", + cwd: "aur", + }); +} + +// Publish to AUR +execSync(`git commit -m "release: release v${pkgver}"`, { + stdio: "inherit", + cwd: "aur", +}); +execSync(`git push origin master`, { + stdio: "inherit", + cwd: "aur", +}); -- cgit v1.2.3-70-g09d2 From 7edccaf1be357c0a2619a87bc1767bc6c8a95954 Mon Sep 17 00:00:00 2001 From: 苏向夜 Date: Wed, 25 Feb 2026 02:44:58 +0800 Subject: chore: use semifold to release aur --- .changes/config.toml | 4 ---- .changes/release-aur.md | 5 +++++ src-tauri/Cargo.toml | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 .changes/release-aur.md (limited to '.changes/config.toml') diff --git a/.changes/config.toml b/.changes/config.toml index bd02fe4..29d2fee 100644 --- a/.changes/config.toml +++ b/.changes/config.toml @@ -31,10 +31,6 @@ url = "https://crates.io/api/v1/crates/{{ package.name }}/{{ package.version }}" [resolver.rust.pre-check.extra-headers] User-Agent = "Semifold 0.2.10" -[[resolver.rust.publish]] -command = "cargo" -args = ["publish"] - [[resolver.rust.publish]] command = "pnpm" args = ["tsx", "scripts/release-aur.ts"] diff --git a/.changes/release-aur.md b/.changes/release-aur.md new file mode 100644 index 0000000..4d6cba5 --- /dev/null +++ b/.changes/release-aur.md @@ -0,0 +1,5 @@ +--- +dropout: "patch:chore" +--- + +Release Dropout to AUR. diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 5ba731c..db8c8fb 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -6,7 +6,6 @@ authors = ["HsiangNianian"] description = "The DropOut Minecraft Game Launcher" repository = "https://github.com/HydroRoll-Team/DropOut" license = "MIT" -publish = false [package.metadata.deb] depends = "libgtk-3-0" -- cgit v1.2.3-70-g09d2 From f6fd0bd512497352547d5b6a7837442d45ff06eb Mon Sep 17 00:00:00 2001 From: 苏向夜 Date: Wed, 25 Feb 2026 03:06:16 +0800 Subject: fix(ci): fix aur release script path --- .changes/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.changes/config.toml') diff --git a/.changes/config.toml b/.changes/config.toml index 29d2fee..051bf85 100644 --- a/.changes/config.toml +++ b/.changes/config.toml @@ -33,7 +33,7 @@ User-Agent = "Semifold 0.2.10" [[resolver.rust.publish]] command = "pnpm" -args = ["tsx", "scripts/release-aur.ts"] +args = ["tsx", "../scripts/release-aur.ts"] [[resolver.rust.post-version]] command = "pnpm" -- cgit v1.2.3-70-g09d2 From ade4db6b724e4776ff62115b0471b337ba6cce24 Mon Sep 17 00:00:00 2001 From: 苏向夜 Date: Wed, 25 Feb 2026 12:02:30 +0800 Subject: revert: revert due to ci failure This reverts commit f6fd0bd512497352547d5b6a7837442d45ff06eb. --- .changes/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.changes/config.toml') diff --git a/.changes/config.toml b/.changes/config.toml index 051bf85..29d2fee 100644 --- a/.changes/config.toml +++ b/.changes/config.toml @@ -33,7 +33,7 @@ User-Agent = "Semifold 0.2.10" [[resolver.rust.publish]] command = "pnpm" -args = ["tsx", "../scripts/release-aur.ts"] +args = ["tsx", "scripts/release-aur.ts"] [[resolver.rust.post-version]] command = "pnpm" -- cgit v1.2.3-70-g09d2 From 33b49ed67b8045a2534c805f90d95831a3f9d80b Mon Sep 17 00:00:00 2001 From: 苏向夜 Date: Wed, 25 Feb 2026 12:33:17 +0800 Subject: fix(smif): fix aur script path --- .changes/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.changes/config.toml') diff --git a/.changes/config.toml b/.changes/config.toml index 29d2fee..051bf85 100644 --- a/.changes/config.toml +++ b/.changes/config.toml @@ -33,7 +33,7 @@ User-Agent = "Semifold 0.2.10" [[resolver.rust.publish]] command = "pnpm" -args = ["tsx", "scripts/release-aur.ts"] +args = ["tsx", "../scripts/release-aur.ts"] [[resolver.rust.post-version]] command = "pnpm" -- cgit v1.2.3-70-g09d2