mirror of
https://github.com/itsRevela/Revelations-Launcher.git
synced 2026-05-21 18:54:29 +00:00
chore: centralize version management and bump to 1.1.4
Add bump script (pnpm bump <version>) that updates package.json, tauri.conf.json, Cargo.toml, and README in one command. CI workflows now read the version from package.json dynamically. App.tsx reads the version via Vite define instead of hardcoding it.
This commit is contained in:
4
.github/workflows/nightly.yml
vendored
4
.github/workflows/nightly.yml
vendored
@@ -64,6 +64,8 @@ jobs:
|
||||
- name: Build and create DMG for macOS
|
||||
if: matrix.platform == 'macos-latest'
|
||||
run: |
|
||||
APP_VERSION=$(node -p "require('./package.json').version")
|
||||
|
||||
pnpm build
|
||||
cd src-tauri
|
||||
cargo build --release --target ${{ matrix.args }}
|
||||
@@ -76,7 +78,7 @@ jobs:
|
||||
|
||||
cp "src-tauri/target/$TARGET_ARCH/release/revelations-launcher" "src-tauri/target/$TARGET_ARCH/release/bundle/macos/Revelations Launcher.app/Contents/MacOS/"
|
||||
|
||||
printf '<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n<dict>\n <key>CFBundleExecutable</key>\n <string>revelations-launcher</string>\n <key>CFBundleIdentifier</key>\n <string>com.revelations.lce</string>\n <key>CFBundleName</key>\n <string>Revelations Launcher</string>\n <key>CFBundleVersion</key>\n <string>1.1.2</string>\n <key>CFBundleShortVersionString</key>\n <string>1.1.2</string>\n <key>CFBundlePackageType</key>\n <string>APPL</string>\n <key>NSHighResolutionCapable</key>\n <true/>\n <key>LSApplicationCategoryType</key>\n <string>public.app-category.games</string>\n</dict>\n</plist>\n' > "src-tauri/target/$TARGET_ARCH/release/bundle/macos/Revelations Launcher.app/Contents/Info.plist"
|
||||
printf '<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n<dict>\n <key>CFBundleExecutable</key>\n <string>revelations-launcher</string>\n <key>CFBundleIdentifier</key>\n <string>com.revelations.lce</string>\n <key>CFBundleName</key>\n <string>Revelations Launcher</string>\n <key>CFBundleVersion</key>\n <string>'"$APP_VERSION"'</string>\n <key>CFBundleShortVersionString</key>\n <string>'"$APP_VERSION"'</string>\n <key>CFBundlePackageType</key>\n <string>APPL</string>\n <key>NSHighResolutionCapable</key>\n <true/>\n <key>LSApplicationCategoryType</key>\n <string>public.app-category.games</string>\n</dict>\n</plist>\n' > "src-tauri/target/$TARGET_ARCH/release/bundle/macos/Revelations Launcher.app/Contents/Info.plist"
|
||||
|
||||
if [ -f "src-tauri/icons/icon.icns" ]; then
|
||||
cp src-tauri/icons/icon.icns "src-tauri/target/$TARGET_ARCH/release/bundle/macos/Revelations Launcher.app/Contents/Resources/"
|
||||
|
||||
22
.github/workflows/publish.yml
vendored
22
.github/workflows/publish.yml
vendored
@@ -55,23 +55,25 @@ jobs:
|
||||
- name: Create PKG with post-install script
|
||||
if: matrix.platform == 'macos-latest'
|
||||
run: |
|
||||
APP_VERSION=$(node -p "require('./package.json').version")
|
||||
|
||||
# Create temporary directory for PKG creation
|
||||
mkdir -p pkg_temp/scripts
|
||||
cp scripts/postinstall.sh pkg_temp/scripts/
|
||||
|
||||
|
||||
# Build the app first
|
||||
pnpm tauri build -- ${{ matrix.args }}
|
||||
|
||||
|
||||
# Find the built app
|
||||
APP_PATH=$(find src-tauri/target/release/bundle/macos/ -name "*.app" | head -1)
|
||||
APP_NAME=$(basename "$APP_PATH")
|
||||
|
||||
|
||||
# Create PKG with post-install script
|
||||
pkgbuild --root "$APP_PATH/.." \
|
||||
--install-location /Applications \
|
||||
--scripts pkg_temp/scripts \
|
||||
--identifier "com.revelations.lce" \
|
||||
--version "1.0.0" \
|
||||
--version "$APP_VERSION" \
|
||||
--install-location "/Applications" \
|
||||
--root "$APP_PATH" \
|
||||
"Revelations-Launcher.pkg"
|
||||
@@ -82,19 +84,21 @@ jobs:
|
||||
- name: Build and create DMG for macOS
|
||||
if: matrix.platform == 'macos-latest'
|
||||
run: |
|
||||
APP_VERSION=$(node -p "require('./package.json').version")
|
||||
|
||||
pnpm build
|
||||
cd src-tauri
|
||||
cargo build --release --target ${{ matrix.args }}
|
||||
cd ..
|
||||
|
||||
|
||||
TARGET_ARCH=${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}
|
||||
|
||||
|
||||
mkdir -p "src-tauri/target/$TARGET_ARCH/release/bundle/macos/Revelations Launcher.app/Contents/MacOS"
|
||||
mkdir -p "src-tauri/target/$TARGET_ARCH/release/bundle/macos/Revelations Launcher.app/Contents/Resources"
|
||||
|
||||
|
||||
cp "src-tauri/target/$TARGET_ARCH/release/revelations-launcher" "src-tauri/target/$TARGET_ARCH/release/bundle/macos/Revelations Launcher.app/Contents/MacOS/"
|
||||
|
||||
printf '<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n<dict>\n <key>CFBundleExecutable</key>\n <string>revelations-launcher</string>\n <key>CFBundleIdentifier</key>\n <string>com.revelations.lce</string>\n <key>CFBundleName</key>\n <string>Revelations Launcher</string>\n <key>CFBundleVersion</key>\n <string>1.0.0</string>\n <key>CFBundleShortVersionString</key>\n <string>1.0.0</string>\n <key>CFBundlePackageType</key>\n <string>APPL</string>\n <key>NSHighResolutionCapable</key>\n <true/>\n <key>LSApplicationCategoryType</key>\n <string>public.app-category.games</string>\n</dict>\n</plist>\n' > "src-tauri/target/$TARGET_ARCH/release/bundle/macos/Revelations Launcher.app/Contents/Info.plist"
|
||||
|
||||
printf '<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n<dict>\n <key>CFBundleExecutable</key>\n <string>revelations-launcher</string>\n <key>CFBundleIdentifier</key>\n <string>com.revelations.lce</string>\n <key>CFBundleName</key>\n <string>Revelations Launcher</string>\n <key>CFBundleVersion</key>\n <string>'"$APP_VERSION"'</string>\n <key>CFBundleShortVersionString</key>\n <string>'"$APP_VERSION"'</string>\n <key>CFBundlePackageType</key>\n <string>APPL</string>\n <key>NSHighResolutionCapable</key>\n <true/>\n <key>LSApplicationCategoryType</key>\n <string>public.app-category.games</string>\n</dict>\n</plist>\n' > "src-tauri/target/$TARGET_ARCH/release/bundle/macos/Revelations Launcher.app/Contents/Info.plist"
|
||||
|
||||
if [ -f "src-tauri/icons/icon.icns" ]; then
|
||||
cp src-tauri/icons/icon.icns "src-tauri/target/$TARGET_ARCH/release/bundle/macos/Revelations Launcher.app/Contents/Resources/"
|
||||
|
||||
@@ -32,7 +32,7 @@ More versions coming in future updates.
|
||||
|
||||
---
|
||||
|
||||
### LATEST: v1.1.2
|
||||
### LATEST: v1.1.4
|
||||
|
||||
- Automatic game update detection with one-click updates (for custom instances, too!)
|
||||
- Custom skin support with PCK packing (Steve & Alex models) (Other players can see your skin)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "revelations-launcher",
|
||||
"private": true,
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.4",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -9,7 +9,8 @@
|
||||
"preview": "vite preview",
|
||||
"tauri": "tauri",
|
||||
"tauri:build": "tauri build && pnpm run post-build:macos",
|
||||
"post-build:macos": "sh src-tauri/scripts/post-build-macos.sh"
|
||||
"post-build:macos": "sh src-tauri/scripts/post-build-macos.sh",
|
||||
"bump": "node scripts/bump-version.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2",
|
||||
|
||||
44
scripts/bump-version.mjs
Normal file
44
scripts/bump-version.mjs
Normal file
@@ -0,0 +1,44 @@
|
||||
import { readFileSync, writeFileSync } from "fs";
|
||||
import { resolve, dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
||||
const version = process.argv[2];
|
||||
|
||||
if (!version || !/^\d+\.\d+\.\d+$/.test(version)) {
|
||||
console.error("Usage: pnpm bump <version> (e.g. pnpm bump 1.2.0)");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const files = [
|
||||
{
|
||||
path: "package.json",
|
||||
replace: (s) => s.replace(/"version":\s*"[^"]+"/, `"version": "${version}"`),
|
||||
},
|
||||
{
|
||||
path: "src-tauri/tauri.conf.json",
|
||||
replace: (s) => s.replace(/"version":\s*"[^"]+"/, `"version": "${version}"`),
|
||||
},
|
||||
{
|
||||
path: "src-tauri/Cargo.toml",
|
||||
replace: (s) => s.replace(/^version = "[^"]+"/m, `version = "${version}"`),
|
||||
},
|
||||
{
|
||||
path: "README.md",
|
||||
replace: (s) => s.replace(/### LATEST: v[\d.]+/, `### LATEST: v${version}`),
|
||||
},
|
||||
];
|
||||
|
||||
for (const file of files) {
|
||||
const fullPath = resolve(root, file.path);
|
||||
const original = readFileSync(fullPath, "utf-8");
|
||||
const updated = file.replace(original);
|
||||
if (original === updated) {
|
||||
console.warn(` skip ${file.path} (no match or already at ${version})`);
|
||||
} else {
|
||||
writeFileSync(fullPath, updated);
|
||||
console.log(` done ${file.path} -> ${version}`);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`\nBumped to ${version}`);
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revelations-launcher"
|
||||
version = "1.1.2"
|
||||
version = "1.1.4"
|
||||
description = "A FOSS, cross-platform launcher for Minecraft Legacy Console Edition"
|
||||
authors = ["itsRevela"]
|
||||
edition = "2021"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Revelations Launcher",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.4",
|
||||
"identifier": "com.revelations.lce",
|
||||
"build": {
|
||||
"beforeDevCommand": "npm run dev",
|
||||
|
||||
@@ -346,7 +346,7 @@ export default function App() {
|
||||
className="shrink-0 p-4 flex justify-between items-end text-[10px] text-[#A0A0A0] mc-text-shadow bg-gradient-to-t from-black/80 to-transparent uppercase tracking-widest opacity-60 font-['Mojangles']"
|
||||
style={{ fontWeight: "normal" }}
|
||||
>
|
||||
<div className="flex-1 text-left whitespace-nowrap">Version: 1.1.2</div>
|
||||
<div className="flex-1 text-left whitespace-nowrap">Version: {__APP_VERSION__}</div>
|
||||
<div className="flex-[2] text-center whitespace-nowrap">
|
||||
Not affiliated with Mojang AB or Microsoft. "Minecraft" is a trademark of Mojang Synergies AB.
|
||||
</div>
|
||||
|
||||
2
src/vite-env.d.ts
vendored
2
src/vite-env.d.ts
vendored
@@ -1 +1,3 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
declare const __APP_VERSION__: string;
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import pkg from './package.json' with { type: 'json' }
|
||||
|
||||
export default defineConfig({
|
||||
define: {
|
||||
__APP_VERSION__: JSON.stringify(pkg.version),
|
||||
},
|
||||
plugins: [
|
||||
react(),
|
||||
tailwindcss(),
|
||||
|
||||
Reference in New Issue
Block a user