From 318606b07d735a26555bc588ca2a525315b4a56d Mon Sep 17 00:00:00 2001 From: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com> Date: Sun, 27 Oct 2024 17:00:27 +0800 Subject: [PATCH 1/2] Added config for debian release with `cargo deb` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The resulting structure is: ``` ├── control │   ├── control │   └── sha256sums ├── debian-binary └── usr ├── bin │   ├── plastic │   └── plastic_tui └── share ├── applications │   └── plastic.desktop ├── doc │   └── plastic │   ├── copyright │   └── README.md ├── icons │   └── plastic-icon.png ├── licenses │   └── plastic │   └── LICENSE └── man └── man1 └── plastic.1.gz ``` Signed-off-by: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com> --- package/plastic.desktop | 9 +++++++++ plastic_tui/Cargo.toml | 2 +- plastic_ui/Cargo.toml | 21 ++++++++++++++++++++- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 package/plastic.desktop diff --git a/package/plastic.desktop b/package/plastic.desktop new file mode 100644 index 0000000..0fa97ca --- /dev/null +++ b/package/plastic.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=Plastic - NES +Comment=Plastic - NES Emulator +Icon=/usr/share/icons/plastic-icon.png +Exec=/usr/bin/plastic +Terminal=false +Categories=Game; + diff --git a/plastic_tui/Cargo.toml b/plastic_tui/Cargo.toml index 98a9432..88ef210 100644 --- a/plastic_tui/Cargo.toml +++ b/plastic_tui/Cargo.toml @@ -3,7 +3,7 @@ name = "plastic_tui" version = "0.3.3" authors = ["Amjad Alsharafi "] edition = "2021" -description = "An accurate NES emulator. Front-end terminal interface (TUI) for plastic-core" +description = "A NES emulator with terminal interface (TUI)" readme = "../README.md" repository = "https://github.com/Amjad50/plastic" license = "MIT" diff --git a/plastic_ui/Cargo.toml b/plastic_ui/Cargo.toml index bb5249f..1dc64fe 100644 --- a/plastic_ui/Cargo.toml +++ b/plastic_ui/Cargo.toml @@ -3,7 +3,7 @@ name = "plastic" version = "0.3.1" authors = ["Amjad Alsharafi "] edition = "2021" -description = "An accurate NES emulator. Front-end for plastic-core" +description = "A NES emulator with GUI and TUI" readme = "../README.md" repository = "https://github.com/Amjad50/plastic" license = "MIT" @@ -20,3 +20,22 @@ eframe = "0.29" rfd = "0.15" dynwave = "0.1" +[package.metadata.deb] +name = "plastic" +maintainer = "Plastic Maintainers , Hadi Chokr >" +extended-description = "" # to block usage of README.md +license-file = ["LICENSE", "0"] +depends = ["libasound2-dev", "libudev-dev"] +copyright = "2020, Amjad Alsharafi " +priority = "optional" +section = "games" +assets = [ + ["target/release/plastic", "usr/bin/", "755"], + ["target/release/plastic_tui", "usr/bin/", "755"], + ["../LICENSE", "usr/share/licenses/plastic/", "644"], + ["../README.md", "usr/share/doc/plastic/", "644"], + ["../docs/man/plastic.1", "usr/share/man/man1/", "644"], + ["../package/plastic.desktop", "usr/share/applications/", "644"], + ["../images/icon.png", "usr/share/icons/plastic-icon.png", "644"], +] + From 7de9ea5c0530bc0e99bff0dbae829f06f80d2d19 Mon Sep 17 00:00:00 2001 From: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com> Date: Sun, 27 Oct 2024 17:06:25 +0800 Subject: [PATCH 2/2] Add `cargo deb` to github actions with releasing and artifacts Signed-off-by: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com> --- .github/workflows/rust.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4ace744..9a90f44 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -28,6 +28,11 @@ jobs: - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov + - uses: cargo-bins/cargo-binstall@main + + - name: Install cargo-deb + run: cargo binstall cargo-deb -y + - name: Use sccache-cache uses: mozilla-actions/sccache-action@v0.0.6 @@ -63,6 +68,32 @@ jobs: files: lcov.info fail_ci_if_error: true + - name: Create Debian package + run: cargo deb + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" + + - name: Upload debian package artifact + if: github.ref == 'refs/heads/master' + uses: actions/upload-artifact@v4 + with: + name: plastic.deb + path: target/debian/*.deb + overwrite: true + + - name: Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + name: Release ${{ github.ref_name }} + body: | + Release ${{ github.ref_name }} + token: ${{ secrets.GITHUB_TOKEN }} + files: | + target/debian/*.deb + LICENSE + windows: runs-on: windows-latest