Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
289 changes: 289 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,289 @@
name: Build

on:
workflow_dispatch:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
release:
types: [published]

env:
CARGO_TERM_COLOR: always

jobs:
build-ui:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
cache-dependency-path: src/celemod-ui/yarn.lock
- name: Install UI dependencies
working-directory: src/celemod-ui
run: yarn install --frozen-lockfile
- name: Build UI resources
working-directory: src/celemod-ui
run: yarn build
- uses: actions/upload-artifact@v4.3.1
with:
name: ui-dist
path: resources/dist.rc
build-windows:
needs: build-ui
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v4
with:
name: ui-dist
path: resources
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Build Rust
run: cargo build --verbose --release
- name: Copy Dependencies
run: cp ./resources/sciter.dll ./target/release/sciter.dll
- name: Create Windows zip
run: Compress-Archive -Path ./target/release/cele-mod.exe,./target/release/sciter.dll -DestinationPath "celemod-windows.zip"
- uses: actions/upload-artifact@v4.3.1
with:
name: windows-exe
path: ./target/release/cele-mod.exe
- uses: actions/upload-artifact@v4.3.1
with:
name: windows-zip
path: celemod-windows.zip
build-linux:
needs: build-ui
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo sh -c 'echo "deb http://archive.ubuntu.com/ubuntu focal-updates main" > /etc/apt/sources.list.d/focal-updates.list'
sudo apt-get update
sudo apt-get install -y \
pkg-config \
cmake \
clang \
libpango-1.0-0 \
libatk1.0-dev \
libgtk-3-dev \
file
- uses: actions/checkout@v3
- uses: actions/download-artifact@v4
with:
name: ui-dist
path: resources
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Build Rust
run: cargo build --verbose --release
- name: Download AppImage tools
run: |
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget -q https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage appimagetool-x86_64.AppImage
- name: Create AppDir
run: |
mkdir -p AppDir/usr/bin
mkdir -p AppDir/usr/lib
mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
mkdir -p AppDir/usr/share/applications

# Copy binary and library
cp ./target/release/cele-mod AppDir/usr/bin/cele-mod
cp ./resources/libsciter.so AppDir/usr/lib/libsciter.so
chmod +x AppDir/usr/bin/cele-mod

# Copy icon
cp ./resources/icon.png AppDir/usr/share/icons/hicolor/256x256/apps/celemod.png

# Create .desktop file
cat > AppDir/usr/share/applications/celemod.desktop << 'EOF'
[Desktop Entry]
Name=CeleMod
Comment=Celeste Mod Manager
Exec=cele-mod
Icon=celemod
Terminal=false
Type=Application
Categories=Game;Utility;
EOF

# Create AppRun wrapper script to set GDK_BACKEND=x11
cat > AppDir/AppRun << 'EOF'
#!/bin/sh
export GDK_BACKEND=x11
exec "$(dirname "$(readlink -f "$0")")/usr/bin/cele-mod" "$@"
EOF
chmod +x AppDir/AppRun

# Create symlinks
ln -s usr/share/applications/celemod.desktop AppDir/celemod.desktop
ln -s usr/share/icons/hicolor/256x256/apps/celemod.png AppDir/celemod.png
- name: Build AppImage
run: |
ARCH=x86_64 ./linuxdeploy-x86_64.AppImage --appdir AppDir --output appimage || true
# Fallback: use appimagetool directly if linuxdeploy fails
if [ ! -f CeleMod-*.AppImage ]; then
ARCH=x86_64 ./appimagetool-x86_64.AppImage AppDir CeleMod-x86_64.AppImage
fi
mv CeleMod-*.AppImage celemod-linux.AppImage || true
- name: Create zip fallback
run: |
mkdir -p celemod-linux
cp ./target/release/cele-mod celemod-linux/cele-mod
cp ./resources/libsciter.so celemod-linux/libsciter.so
cp ./resources/icon.png celemod-linux/celemod.png
zip -r "celemod-linux.zip" celemod-linux
- uses: actions/upload-artifact@v4.3.1
with:
name: linux-zip
path: celemod-linux.zip
- uses: actions/upload-artifact@v4.3.1
with:
name: linux-appimage
path: celemod-linux.AppImage
build-macos:
needs: build-ui
runs-on: macos-latest
steps:
- name: Install dependencies
run: |
brew install pango
brew install gtk+3
brew install protobuf
brew install create-dmg
- uses: actions/checkout@v3
- uses: actions/download-artifact@v4
with:
name: ui-dist
path: resources
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Build Rust MacOS
run: export CMAKE_POLICY_VERSION_MINIMUM=3.5 && cargo build --verbose --release
- name: Create macOS app bundle
run: |
mkdir -p CeleMod.app/Contents/MacOS
mkdir -p CeleMod.app/Contents/Resources
cp ./target/release/cele-mod CeleMod.app/Contents/MacOS/CeleMod
cp ./resources/libsciter.dylib CeleMod.app/Contents/MacOS/libsciter.dylib
cp ./resources/icon.icns CeleMod.app/Contents/Resources/AppIcon.icns
chmod +x CeleMod.app/Contents/MacOS/CeleMod

# Create Info.plist with icon
cat > CeleMod.app/Contents/Info.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>CeleMod</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>CFBundleIdentifier</key>
<string>com.celemod.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>CeleMod</string>
<key>CFBundleDisplayName</key>
<string>CeleMod</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2024 CeleMod. All rights reserved.</string>
</dict>
</plist>
EOF
- name: Ad-hoc sign app bundle
run: |
codesign --force --deep -s - CeleMod.app
- name: Create DMG (optional)
run: |
create-dmg --volname "CeleMod" --volicon "./resources/icon.icns" --window-pos 200 120 --window-size 800 400 --icon-size 100 --app-drop-link 600 185 "CeleMod.dmg" "CeleMod.app" || true
# If create-dmg fails, just zip the app
if [ ! -f CeleMod.dmg ]; then
zip -r "celemod-macos.zip" CeleMod.app
fi
- name: Prepare artifact
run: |
if [ -f CeleMod.dmg ]; then
mv CeleMod.dmg celemod-macos.dmg
else
# Ensure zip exists
if [ ! -f celemod-macos.zip ]; then
zip -r "celemod-macos.zip" CeleMod.app
fi
fi
- uses: actions/upload-artifact@v4.3.1
with:
name: macos-app
path: |
celemod-macos.dmg
celemod-macos.zip
release:
runs-on: ubuntu-latest
needs: [build-windows, build-linux, build-macos]
if: github.event_name == 'release'
steps:
- uses: actions/download-artifact@v4
with:
name: windows-exe
path: .
- uses: actions/download-artifact@v4
with:
name: windows-zip
path: .
- uses: actions/download-artifact@v4
with:
name: linux-zip
path: .
- uses: actions/download-artifact@v4
with:
name: linux-appimage
path: .
- uses: actions/download-artifact@v4
with:
name: macos-app
path: .
- name: Prepare release files
run: mv cele-mod.exe "cele-mod-no-dependencies.exe"
- uses: softprops/action-gh-release@v1
with:
files: |
cele-mod-no-dependencies.exe
celemod-windows.zip
celemod-linux.zip
celemod-linux.AppImage
celemod-macos.dmg
celemod-macos.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Binary file modified resources/dist.rc
Binary file not shown.
30 changes: 16 additions & 14 deletions src/celemod-ui/src/routes/Everest.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,40 +135,42 @@
horizontal-align: center;

.wrapperin {
padding-right: 20px;
padding-bottom: 10px;
font-size: 100px;
padding-bottom: 14px;
font-size: 88px;
}

&>* {
width: max-content;
}

.tip {
font-size: 20px;
font-size: 34px;
font-weight: 700;
margin-right: 20px;
margin-right: 0;
margin-bottom: 8px;
}

.url {
font-size: 15px;
font-size: 14px;
font-weight: 500;
margin-right: 12px;
max-width: 90%;
max-width: 78%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
opacity: 0.8;
opacity: 0.62;
}

.state {
font-size: 15px;
font-weight: 700;
margin-top: 10px;
padding-right: 20px;
width: 90%;
font-size: 13px;
font-weight: 500;
margin-top: 8px;
width: 78%;
text-align: center;
horizontal-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
opacity: 0.72;

textarea {
text-align: left;
Expand Down
28 changes: 21 additions & 7 deletions src/celemod-ui/src/routes/Everest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ interface Maddie480EverestVersion {
isNative: boolean;
}

const getInstallTip = (state: string | null) => {
if (state?.startsWith('[1/3]')) return '正在下载';
if (state?.startsWith('[2/3]')) return '正在解压';
return '正在安装';
};

const getInstallDetail = (state: string | null) => {
if (!state) return null;
return state
.replace(/^\[\d+\/\d+\]\s*/, '')
.replace(/^Download Everest:?/i, '')
.replace(/^Extract Everest files:?/i, '')
.replace(/^Run MiniInstaller:?/i, '')
.trim();
};

const Channel = ({
dataFull,
branch,
Expand Down Expand Up @@ -106,7 +122,7 @@ export const Everest = () => {
setInstallingUrl(url);
setInstallProgress(null);
setFailedReason(null);
setInstallState('Downloading Everest');
setInstallState('[1/3] Download Everest');
callRemote(
'download_and_install_everest',
gamePath,
Expand Down Expand Up @@ -283,13 +299,11 @@ export const Everest = () => {
})}
/>
</div>
<div className="tip">
{installState === 'Downloading Everest'
? _i18n.t('正在下载')
: _i18n.t('正在安装')}
</div>
<div className="tip">{getInstallTip(installState)}</div>
<div className="url">{installingUrl}</div>
<div className="state">{installState}</div>
{getInstallDetail(installState) ? (
<div className="state">{getInstallDetail(installState)}</div>
) : null}
</Fragment>
)}
</div>
Expand Down
Loading