diff --git a/.github/workflows/appbundle.yml b/.github/workflows/appbundle.yml deleted file mode 100644 index ef29ff4..0000000 --- a/.github/workflows/appbundle.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Rust Appbundle - -on: workflow_dispatch - -env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - CARGO_TERM_COLOR: always - -jobs: - build: - - strategy: - matrix: - os: [macos-12] - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v3 - - name: Run sccache-cache - uses: mozilla-actions/sccache-action@v0.0.3 - - name: Build - run: cargo build --verbose - - name: Build bundle - run: | - chmod +x ./scripts/build-appbundle.sh - ./scripts/build-appbundle.sh - - name: capture build artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ matrix.os }} - path: macos_bundle/Installer.app diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5a4b39d..1d57884 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -30,6 +30,8 @@ jobs: sudo apt-get install -y gcc pkg-config libglib2.0-dev libgtk-3-dev libssl-dev libjavascriptcoregtk-4.1-dev libsoup-3.0-dev libwebkit2gtk-4.1-dev - name: Build run: cargo build --verbose --release + - name: Strip debug info + run: strip target/release/installer - name: capture build artifacts windows if: ${{ matrix.os == 'windows-2022' }} uses: actions/upload-artifact@v2 diff --git a/.github/workflows/rust_debug.yml b/.github/workflows/rust_debug.yml deleted file mode 100644 index bded828..0000000 --- a/.github/workflows/rust_debug.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Rust Debug - -on: workflow_dispatch - -env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - CARGO_TERM_COLOR: always - -jobs: - build: - - strategy: - matrix: - os: [ubuntu-22.04, windows-2022, macos-12] - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v3 - - name: Run sccache-cache - uses: mozilla-actions/sccache-action@v0.0.3 - - name: install dependencies - if: ${{ matrix.os == 'ubuntu-22.04' }} - run: | - sudo apt-get update - sudo apt-get install -y gcc pkg-config libglib2.0-dev libgtk-3-dev libssl-dev libjavascriptcoregtk-4.1-dev libsoup-3.0-dev libwebkit2gtk-4.1-dev - - name: Build - run: cargo build --verbose - - name: capture build artifacts windows - if: ${{ matrix.os == 'windows-2022' }} - uses: actions/upload-artifact@v2 - with: - name: ${{ matrix.os }} - path: target/debug/installer.exe - - name: capture build artifacts - if: ${{ matrix.os != 'windows-2022' }} - uses: actions/upload-artifact@v2 - with: - name: ${{ matrix.os }} - path: target/debug/installer diff --git a/Cargo.toml b/Cargo.toml index c66e6a2..f3e6a23 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,10 +9,7 @@ build = "build.rs" [profile.release] opt-level = "s" lto = "fat" - -[profile.dev] -opt-level = "s" -lto = "fat" +strip = true [dependencies] diff --git a/scripts/build-appbundle.sh b/scripts/build-appbundle.sh deleted file mode 100644 index 28b60a2..0000000 --- a/scripts/build-appbundle.sh +++ /dev/null @@ -1,21 +0,0 @@ -mkdir macos_bundle/ -mkdir macos_bundle/Installer.app/ -mkdir macos_bundle/Installer.app/Contents/ -mkdir macos_bundle/Installer.app/Contents/Resources -mkdir macos_bundle/Installer.app/Contents/MacOS/ -cp icon_256.icns macos_bundle/Installer.app/Contents/Resources/icon_256.icns -cp target/debug/installer macos_bundle/Installer.app/Contents/MacOS/installer -cat > macos_bundle/Installer.app/Contents/Info.plist << EOF -{ - CFBundleName = installer; - CFBundleDisplayName = Majestic Overhaul Installer; - CFBundleIdentifier = "io.github.wynncraft-overhaul"; - CFBundleVersion = "1.0.0"; - CFBundleShortVersionString = "1.0.0"; - CFBundleInfoDictionaryVersion = "6.0"; - CFBundlePackageType = APPL; - CFBundleSignature = inst; - CFBundleExecutable = installer; - CFBundleIconFile = "icon_256.icns"; -} -EOF diff --git a/src/main.rs b/src/main.rs index 9d89d2d..0966388 100644 --- a/src/main.rs +++ b/src/main.rs @@ -163,7 +163,6 @@ async fn get_cached(http_client: &HttpClient, url: String) -> Result HttpClient { HttpClient::builder() .redirect_policy(RedirectPolicy::Limit(5)) @@ -174,14 +173,7 @@ fn build_http_client() -> HttpClient { .build() .unwrap() } -#[cfg(not(debug_assertions))] -fn build_http_client() -> HttpClient { - HttpClient::builder() - .redirect_policy(RedirectPolicy::Limit(5)) - .default_headers(&[("User-Agent", "wynncraft-overhaul/installer/0.1.0")]) - .build() - .unwrap() -} + #[async_trait] trait Downloadable { async fn download( diff --git a/src/pat b/src/pat index e70b9da..4ab8d69 100644 --- a/src/pat +++ b/src/pat @@ -1 +1 @@ -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 \ No newline at end of file +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 \ No newline at end of file