Skip to content

Commit

Permalink
Abandon musl for now
Browse files Browse the repository at this point in the history
  • Loading branch information
NotNite committed Oct 6, 2024
1 parent 2cfb8ee commit 35a8802
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 31 deletions.
21 changes: 5 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,19 @@ jobs:
path: target/release/moonlight-installer.exe

build-linux:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-musl
- name: Set musl toolchain as default
run: rustup default stable-x86_64-unknown-linux-musl
- uses: Swatinem/rust-cache@v2

- name: Download appimcagetool
run: |
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$(uname -m).AppImage -O ./appimagetool
chmod +x ./appimagetool
- name: Install musl-gcc
run: sudo apt-get install -y musl-tools
- name: Install cargo-appimage
run: cargo install cargo-appimage

- name: Build
run: ./build-linux.sh
run: |
chmod +x ./build-linux.sh
./build-linux.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: moonlight-installer-linux
path: ./target/appimage/moonlight-installer.AppImage
path: ./moonlight-installer-x86_64.AppImage
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/target
/appimagetool
/appdir
*.AppImage
File renamed without changes.
File renamed without changes
7 changes: 7 additions & 0 deletions assets/moonlight-installer.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Desktop Entry]
Name=moonlight installer
Exec=moonlight-installer
Icon=icon
Type=Application
Categories=Utility;
X-AppImage-Version=0.2.0
28 changes: 15 additions & 13 deletions build-linux.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
#!/usr/bin/env sh
set -e

cargo build --release

if [ -d ./appdir ]; then
rm -rf ./appdir
fi
mkdir appdir

cp ./assets/icon.png ./appdir
cp ./target/release/moonlight-installer ./appdir/AppRun
cp ./assets/moonlight-installer.desktop ./appdir

if [ ! -f ./appimagetool ]; then
echo "Downloading appimagetool..."
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$(uname -m).AppImage -O ./appimagetool
chmod +x ./appimagetool
fi
export PATH=$PATH:$(pwd)

if [ -d ./target/moonlight-installer.AppDir ]; then
rm -rf ./target/moonlight-installer.AppDir
fi

if [ -d ./target/appimage ]; then
rm -rf ./target/appimage
fi

cargo build --release --target x86_64-unknown-linux-musl
# ???
cp ./target/x86_64-unknown-linux-musl/release/moonlight-installer ./target/release/moonlight-installer
cargo appimage --target x86_64-unknown-linux-musl
./appimagetool ./appdir moonlight-installer-x86_64.AppImage
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fn main() -> std::io::Result<()> {
#[cfg(windows)]
{
winresource::WindowsResource::new()
.set_icon("icon.ico")
.set_icon("assets/icon.ico")
.compile()?;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn main() -> anyhow::Result<()> {
.with_inner_size([500.0, 250.0])
.with_min_inner_size([200.0, 250.0])
.with_icon(
eframe::icon_data::from_png_bytes(&include_bytes!("../icon.png")[..])
eframe::icon_data::from_png_bytes(&include_bytes!("../assets/icon.png")[..])
.expect("Failed to load icon"),
),
..Default::default()
Expand Down

0 comments on commit 35a8802

Please sign in to comment.