Skip to content

Commit

Permalink
Merge pull request #40 from Amjad50/debian_release
Browse files Browse the repository at this point in the history
Added config for debian release with `cargo deb`
  • Loading branch information
Amjad50 authored Oct 27, 2024
2 parents 979bbde + 7de9ea5 commit 98c57b4
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]

Expand Down Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions package/plastic.desktop
Original file line number Diff line number Diff line change
@@ -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;

2 changes: 1 addition & 1 deletion plastic_tui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "plastic_tui"
version = "0.3.3"
authors = ["Amjad Alsharafi <[email protected]>"]
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"
Expand Down
21 changes: 20 additions & 1 deletion plastic_ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "plastic"
version = "0.3.1"
authors = ["Amjad Alsharafi <[email protected]>"]
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"
Expand All @@ -20,3 +20,22 @@ eframe = "0.29"
rfd = "0.15"
dynwave = "0.1"

[package.metadata.deb]
name = "plastic"
maintainer = "Plastic Maintainers <Amjad Alsharafi <[email protected]>, Hadi Chokr <[email protected]>>"
extended-description = "" # to block usage of README.md
license-file = ["LICENSE", "0"]
depends = ["libasound2-dev", "libudev-dev"]
copyright = "2020, Amjad Alsharafi <[email protected]>"
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"],
]

0 comments on commit 98c57b4

Please sign in to comment.