mirror of https://github.com/Leinnan/rpack.git
Making installer
This commit is contained in:
parent
05a59c35ea
commit
ee44f11d9d
|
|
@ -0,0 +1,54 @@
|
||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- uses: actions/cache@v4
|
||||||
|
continue-on-error: false
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/bin/
|
||||||
|
~/.cargo/registry/index/
|
||||||
|
~/.cargo/registry/cache/
|
||||||
|
~/.cargo/git/db/
|
||||||
|
target/
|
||||||
|
key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-build-
|
||||||
|
- uses: extractions/setup-just@v2
|
||||||
|
- name: Mac build
|
||||||
|
if: startsWith(runner.os, 'macos')
|
||||||
|
working-directory: crates/rpack_egui
|
||||||
|
run: just create_mac_installer
|
||||||
|
- name: Regular installer
|
||||||
|
if: ${{ !startsWith(runner.os, 'macos') }}
|
||||||
|
working-directory: crates/rpack_egui
|
||||||
|
run: |
|
||||||
|
just create_installer
|
||||||
|
mkdir ../../artifacts
|
||||||
|
cp RpackInstaller.pkg ../../artifacts/RpackInstaller.pkg
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
if: startsWith(runner.os, 'macos')
|
||||||
|
with:
|
||||||
|
name: macos-installer
|
||||||
|
path: artifacts
|
||||||
|
- name: Copy artifacts
|
||||||
|
if: ${{ startsWith(runner.os, 'windows') }}
|
||||||
|
run: |
|
||||||
|
mkdir artifacts
|
||||||
|
cp target/release/rpack_egui.exe artifacts/rpack_egui.exe
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
if: startsWith(runner.os, 'windows')
|
||||||
|
with:
|
||||||
|
name: windows-exe
|
||||||
|
path: artifacts
|
||||||
|
|
@ -9,3 +9,5 @@ result.png
|
||||||
/.vscode
|
/.vscode
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
Rpack.app
|
||||||
|
crates/rpack_egui/static/resources
|
||||||
|
|
|
||||||
|
|
@ -45,3 +45,11 @@ web-sys = { version = "0.3", features = [
|
||||||
"BlobPropertyBag",
|
"BlobPropertyBag",
|
||||||
] }
|
] }
|
||||||
js-sys = "0.3"
|
js-sys = "0.3"
|
||||||
|
|
||||||
|
[package.metadata.bundle]
|
||||||
|
name = "Rpack"
|
||||||
|
resources = ["static/resources/*"]
|
||||||
|
identifier = "io.github.leinnan.rpack"
|
||||||
|
osx_url_schemes = ["io.github.leinnan.rpack"]
|
||||||
|
short_description = "Tilemap Editor"
|
||||||
|
long_description = "Tilemap Editor built with egui in Rust"
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 314 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 47 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 128 KiB |
|
|
@ -0,0 +1,50 @@
|
||||||
|
|
||||||
|
_gen_icon size postfix:
|
||||||
|
sips -z {{size}} {{size}} static/base_icon.png --out static/icon.iconset/icon_{{postfix}}.png
|
||||||
|
cp static/icon.iconset/icon_{{postfix}}.png static/resources/{{postfix}}.png
|
||||||
|
|
||||||
|
make_win_icon:
|
||||||
|
convert static/base_icon.png -define icon:auto-resize=16,24,32,48,64,128,256,512 static/icon.ico
|
||||||
|
|
||||||
|
# Build the icon for macOS app
|
||||||
|
make_mac_icon:
|
||||||
|
rm -rf static/icon.iconset
|
||||||
|
mkdir -p static/icon.iconset
|
||||||
|
rm -rf static/resources
|
||||||
|
mkdir -p static/resources
|
||||||
|
just _gen_icon 16 "16x16"
|
||||||
|
just _gen_icon 32 "32x32"
|
||||||
|
just _gen_icon 64 "64x64"
|
||||||
|
just _gen_icon 128 "128x128"
|
||||||
|
just _gen_icon 256 "256x256"
|
||||||
|
just _gen_icon 512 "512x512"
|
||||||
|
just _gen_icon 1024 "1024x1024"
|
||||||
|
just _gen_icon 32 "16x16@2x"
|
||||||
|
just _gen_icon 64 "32x32@2x"
|
||||||
|
just _gen_icon 128 "64x64@2x"
|
||||||
|
just _gen_icon 256 "128x128@2x"
|
||||||
|
just _gen_icon 512 "256x256@2x"
|
||||||
|
just _gen_icon 1024 "512x512@2x"
|
||||||
|
|
||||||
|
iconutil -c icns static/icon.iconset
|
||||||
|
rm -rf static/icon.iconset
|
||||||
|
mv static/icon.icns static/resources/icon.icns
|
||||||
|
|
||||||
|
# Build the macOS app
|
||||||
|
build_mac_app: make_mac_icon
|
||||||
|
rm -rf Rpack.app
|
||||||
|
cargo build --release
|
||||||
|
mkdir -p Rpack.app
|
||||||
|
mkdir -p Rpack.app/Contents
|
||||||
|
mkdir -p Rpack.app/Contents/MacOS
|
||||||
|
mkdir -p Rpack.app/Contents/Resources
|
||||||
|
cp static/Info.plist Rpack.app/Contents/Info.plist
|
||||||
|
cp static/resources/* Rpack.app/Contents/Resources/
|
||||||
|
cp ../../target/release/rpack_egui Rpack.app/Contents/MacOS/rpack_egui
|
||||||
|
|
||||||
|
create_mac_installer: build_mac_app
|
||||||
|
pkgbuild --install-location /Applications --component Rpack.app RpackInstaller.pkg
|
||||||
|
|
||||||
|
# Create the installer using cargo-bundle
|
||||||
|
create_installer:
|
||||||
|
cargo bundle --release
|
||||||
|
|
@ -13,7 +13,11 @@ fn main() -> eframe::Result<()> {
|
||||||
let native_options = eframe::NativeOptions {
|
let native_options = eframe::NativeOptions {
|
||||||
viewport: egui::ViewportBuilder::default()
|
viewport: egui::ViewportBuilder::default()
|
||||||
.with_inner_size([400.0, 300.0])
|
.with_inner_size([400.0, 300.0])
|
||||||
.with_min_inner_size([300.0, 220.0]),
|
.with_icon(
|
||||||
|
eframe::icon_data::from_png_bytes(include_bytes!("../static/base_icon.png"))
|
||||||
|
.unwrap_or_default(),
|
||||||
|
)
|
||||||
|
.with_min_inner_size([400.0, 300.0]),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
eframe::run_native(
|
eframe::run_native(
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?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>CFBundleName</key>
|
||||||
|
<string>Rpack</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>io.github.leinnan.rpack</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>0.3.0</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>rpack_egui</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleIconFile</key>
|
||||||
|
<string>icon</string>
|
||||||
|
<key>CFBundleDocumentTypes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeName</key>
|
||||||
|
<string>Rpack gen config</string>
|
||||||
|
<key>CFBundleTypeExtensions</key>
|
||||||
|
<array>
|
||||||
|
<string>rpack_gen.json</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Editor</string>
|
||||||
|
<key>LSHandlerRank</key>
|
||||||
|
<string>Owner</string>
|
||||||
|
<key>LSItemContentTypes</key>
|
||||||
|
<array>
|
||||||
|
<string>public.data</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1010 KiB |
Loading…
Reference in New Issue