diff --git a/.github/scripts/set-tauri-version.mjs b/.github/scripts/set-tauri-version.mjs index f4d628c01..439d4ed37 100644 --- a/.github/scripts/set-tauri-version.mjs +++ b/.github/scripts/set-tauri-version.mjs @@ -24,6 +24,9 @@ if (updaterEndpoint && !updaterEndpoint.startsWith('https://')) { const file = 'src-tauri/tauri.conf.json'; const config = JSON.parse(readFileSync(file, 'utf8')); config.version = version; +if (version.includes('nightly')) { + config.productName = 'Sable Nightly'; +} if (updaterEndpoint) { config.plugins.updater.endpoints = [updaterEndpoint]; } diff --git a/.github/workflows/tauri-build.yml b/.github/workflows/tauri-build.yml index 710b1cd97..29c89bf96 100644 --- a/.github/workflows/tauri-build.yml +++ b/.github/workflows/tauri-build.yml @@ -132,6 +132,8 @@ jobs: env: TAG: ${{ needs.setup-release.outputs.tag }} VERSION: ${{ needs.setup-release.outputs.version }} + VITE_APP_VERSION: ${{ needs.setup-release.outputs.version }} + VITE_IS_RELEASE_TAG: ${{ needs.setup-release.outputs.nightly == 'true' && 'true' || '' }} NODE_OPTIONS: --max-old-space-size=8192 TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} @@ -292,6 +294,8 @@ jobs: env: TAG: ${{ needs.setup-release.outputs.tag }} VERSION: ${{ needs.setup-release.outputs.version }} + VITE_APP_VERSION: ${{ needs.setup-release.outputs.version }} + VITE_IS_RELEASE_TAG: ${{ needs.setup-release.outputs.nightly == 'true' && 'true' || '' }} NODE_OPTIONS: --max-old-space-size=8192 ANDROID_KEY_BASE64: ${{ secrets.ANDROID_KEY_BASE64 }} ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} @@ -382,6 +386,8 @@ jobs: env: TAG: ${{ needs.setup-release.outputs.tag }} VERSION: ${{ needs.setup-release.outputs.version }} + VITE_APP_VERSION: ${{ needs.setup-release.outputs.version }} + VITE_IS_RELEASE_TAG: ${{ needs.setup-release.outputs.nightly == 'true' && 'true' || '' }} NODE_OPTIONS: --max-old-space-size=8192 steps: - name: Checkout repository @@ -468,6 +474,8 @@ jobs: env: TAG: ${{ needs.setup-release.outputs.tag }} VERSION: ${{ needs.setup-release.outputs.version }} + VITE_APP_VERSION: ${{ needs.setup-release.outputs.version }} + VITE_IS_RELEASE_TAG: ${{ needs.setup-release.outputs.nightly == 'true' && 'true' || '' }} REPO: ${{ github.repository }} STARTED_AT: ${{ needs.setup-release.outputs.started_at }} steps: diff --git a/scripts/cef-package.sh b/scripts/cef-package.sh index 419263b4b..deee504e4 100755 --- a/scripts/cef-package.sh +++ b/scripts/cef-package.sh @@ -23,10 +23,16 @@ STAGE="$ROOT/src-tauri/target/release" OUT="$STAGE/bundle" WORK="$STAGE/cef-pkg" -[ -x "$STAGE/sable" ] || { - echo "missing $STAGE/sable; build it first (pnpm tauri:cef build)" >&2 +if [ -x "$STAGE/Sable Nightly" ]; then + BIN_NAME="Sable Nightly" +elif [ -x "$STAGE/Sable" ]; then + BIN_NAME="Sable" +elif [ -x "$STAGE/sable" ]; then + BIN_NAME="sable" +else + echo "missing $STAGE/Sable or sable; build it first (pnpm tauri:cef build)" >&2 exit 1 -} +fi rm -rf "$WORK" mkdir -p "$WORK" "$OUT/deb" "$OUT/rpm" "$OUT/appimage" @@ -34,7 +40,7 @@ mkdir -p "$WORK" "$OUT/deb" "$OUT/rpm" "$OUT/appimage" stage_runtime() { local dest="$1" mkdir -p "$dest" - cp "$STAGE/sable" "$dest/" + cp "$STAGE/$BIN_NAME" "$dest/sable" bash scripts/cef-copy-libs.sh release "$dest" } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index eae8d7ba2..2b601c854 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,6 +1,6 @@ { "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", - "productName": "sable", + "productName": "Sable", "version": "1.20.0", "identifier": "moe.sable.client", "build": { diff --git a/vite.config.ts b/vite.config.ts index 05576534e..848723f4a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -47,7 +47,7 @@ const resolveBuildHash = (): string | undefined => { } }; -const appVersion = packageJson.version; +const appVersion = process.env.VITE_APP_VERSION || packageJson.version; const buildHash = resolveBuildHash(); const tauriDevHost = process.env.TAURI_DEV_HOST; const isTauriBuild = Boolean(process.env.TAURI_ENV_PLATFORM);