diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml new file mode 100644 index 0000000..f375b90 --- /dev/null +++ b/.github/workflows/rust-release.yml @@ -0,0 +1,43 @@ +name: Rust - Release creation + +on: + release: + types: [created] + +jobs: + create-release: + runs-on: ubuntu-latest + + steps: + - name: "Checkout repository" + uses: actions/checkout@v4 + + - name: "Set up Rust" + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: "Install dependencies" + run: | + sudo apt update + sudo apt install -y rpm + cargo install cargo-deb + cargo install cargo-generate-rpm + + - name: "build-release" + run: cargo build --release + + - name: "Build DEB package" + run: cargo deb -p adb_cli + + - name: "Build RPM package" + run: cargo generate-rpm -p adb_cli + + - name: "Publish deb package" + uses: softprops/action-gh-release@v2 + with: + files: | + target/debian/*.deb + target/generate-rpm/*.rpm + target/release/adb_cli \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index d9299b4..2710bf7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,11 +3,13 @@ members = ["adb_cli", "adb_client"] resolver = "2" [workspace.package] +authors = ["Corentin LIAUD"] edition = "2021" +homepage = "https://github.com/cocool97/adb_client" keywords = ["adb", "android", "tcp", "usb"] license-file = "LICENSE" repository = "https://github.com/cocool97/adb_client" -version = "2.0.1" +version = "2.0.2" # To build locally when working on a new release [patch.crates-io] @@ -19,14 +21,3 @@ debug-assertions = false lto = "thin" opt-level = 'z' strip = true - -[workspace.metadata.deb] -extended-description = """\ -Interact with ADB server with or without using ADB server. -""" -depends = "$auto" -section = "utility" -priority = "optional" -assets = [ - { source = "target/release/adb_cli", dest = "usr/bin/", mode = "755"}, -] \ No newline at end of file diff --git a/adb_cli/Cargo.toml b/adb_cli/Cargo.toml index ff46106..f7e38c5 100644 --- a/adb_cli/Cargo.toml +++ b/adb_cli/Cargo.toml @@ -1,4 +1,5 @@ [package] +authors.workspace = true description = "Rust ADB (Android Debug Bridge) CLI" edition.workspace = true keywords.workspace = true @@ -17,3 +18,22 @@ log = { version = "0.4.22" } [target.'cfg(unix)'.dependencies] termios = { version = "0.3.3" } + +##################################### +# Debian package build instructions # +##################################### +[package.metadata.deb] +assets = [ + { source = "target/release/adb_cli", dest = "usr/bin/", mode = "755" }, +] +priority = "optional" +section = "utility" + +################################## +# RPM package build instructions # +################################## +[package.metadata.generate-rpm] +assets = [ + { source = "target/release/adb_cli", dest = "/usr/bin/adb_cli", mode = "755" }, +] +license = "MIT" diff --git a/adb_client/Cargo.toml b/adb_client/Cargo.toml index 0df991a..28a6730 100644 --- a/adb_client/Cargo.toml +++ b/adb_client/Cargo.toml @@ -1,4 +1,5 @@ [package] +authors.workspace = true description = "Rust ADB (Android Debug Bridge) client library" edition.workspace = true keywords.workspace = true