diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index 12dc4ab..2d3fd0c 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -93,6 +93,7 @@ jobs: command: build args: --release --target ${{ matrix.target }} --manifest-path ./apps/desktop/Cargo.toml - run: mv ./apps/desktop/target . + - name: Strip release binary (linux and macos) if: matrix.build == 'x86_64-linux' || matrix.build == 'x86_64-macos' run: strip "target/${{ matrix.target }}/release/$BIN_NAME" @@ -106,6 +107,8 @@ jobs: aarch64-linux-gnu-strip \ /target/${{ matrix.target }}/release/$BIN_NAME + - run: mv target/ ./apps/desktop/target + - name: Install Wix if: matrix.build == 'x86_64-windows' uses: actions/checkout@v2 @@ -117,15 +120,16 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: 3.1.101 + - name: install cargo wix if: matrix.build == 'x86_64-windows' run: cargo install cargo-wix - name: run wix command if: matrix.build == 'x86_64-windows' - run: cargo wix init - - name: run wix command - if: matrix.build == 'x86_64-windows' - run: cargo wix + run: | + cd apps/desktop + cargo wix init + cargo wix - name: make dist run: mkdir dist @@ -139,7 +143,9 @@ jobs: - name: Create deb file if: matrix.build == 'x86_64-linux' - run: cargo deb + run: cargo deb --manifest-path ./apps/desktop/Cargo.toml + - run: rm -rf target/ + - run: mv ./apps/desktop/target . - name: cp deb file if: matrix.build == 'x86_64-linux' diff --git a/apps/desktop/Cargo.lock b/apps/desktop/Cargo.lock index c2ecaa8..80681f5 100644 --- a/apps/desktop/Cargo.lock +++ b/apps/desktop/Cargo.lock @@ -76,13 +76,16 @@ dependencies = [ "home", "iced", "itertools", + "libc", "native-dialog", + "openssl", "reqwest", "rustc-hash", "serde", "serde_json", "tokio 1.15.0", "toml", + "winapi 0.3.9", ] [[package]] @@ -2143,6 +2146,15 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" +[[package]] +name = "openssl-src" +version = "111.17.0+1.1.1m" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d6a336abd10814198f66e2a91ccd7336611f30334119ca8ce300536666fcf4" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.72" @@ -2152,6 +2164,7 @@ dependencies = [ "autocfg 1.0.1", "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] diff --git a/apps/desktop/Cargo.toml b/apps/desktop/Cargo.toml index 652b15e..8664485 100644 --- a/apps/desktop/Cargo.toml +++ b/apps/desktop/Cargo.toml @@ -26,3 +26,31 @@ features = ["windows_dpi_awareness", "windows_visual_styles"] [build-dependencies] embed-resource = "1.3" + +[target.'cfg(unix)'.dependencies] +openssl = { version = "0.10.38", features = ["vendored"] } +libc = "0.2.107" + +[target.'cfg(windows)'.build-dependencies] +winapi = "0.3.9" + +[package.metadata.deb] +maintainer = "Tricked-dev" +copyright = "2022, Tricked-dev" +license-file = ["LICENSE", "4"] +extended-description = """https://github.com/Tricked-dev/diplo""" +depends = "$auto" +section = "utility" +priority = "optional" +assets = [ + [ + "target/release/ascella", + "usr/bin/", + "755", + ], + [ + "README.md", + "usr/share/doc/ascella/README", + "644", + ], +] \ No newline at end of file diff --git a/apps/desktop/src/lib.rs b/apps/desktop/src/lib.rs index 2adda25..9476c6f 100644 --- a/apps/desktop/src/lib.rs +++ b/apps/desktop/src/lib.rs @@ -35,7 +35,7 @@ fn session_type() -> SessionKind { fn session_type() -> SessionKind { SessionKind::Macos } - +#[cfg(not(any(target_os = "macos", target_os = "windows")))] fn session_type() -> SessionKind { return match env::var("XDG_SESSION_TYPE") { Ok(ok) => match ok.to_lowercase().as_ref() {