Skip to content

Commit

Permalink
feat: add deb package workflow
Browse files Browse the repository at this point in the history
* Deb Package Workflow (#5)
* Update rust.yml
* Action Update 1.0.0
* Requested Changes
  • Loading branch information
DominicOrsi authored Jun 25, 2024
1 parent 1ee7b90 commit 3c08596
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 3 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,31 @@ on:

env:
CARGO_TERM_COLOR: always
RELEASE_TAG: 0.5.1-1 # This is the version of the package, it should be updated with every release

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
run: cargo build --verbose --release
- name: Run tests
run: cargo test --verbose

- name: Create Debian package
uses: dominicorsi/cargo-deb-ubuntu@1.0.0

- name: Upload Netscanner Debian Package (amd64)
uses: actions/upload-artifact@v4
with:
name: netscanner_${{ env.RELEASE_TAG }}_amd64.deb
path: netscanner_${{ env.RELEASE_TAG }}_amd64.deb

- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: netscanner_${{ env.RELEASE_TAG }}_amd64.deb
37 changes: 36 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,48 @@ authors = ["Chleba <chlebik@gmail.com>"]
repository = "https://github.com/Chleba/netscanner"
homepage = "https://github.com/Chleba/netscanner"

[package.metadata.deb]
maintainer = "Dominic Orsi <dominic.orsi@gmail.com>"
depends = "iw"
section = "utils"
priority = "optional"
changelog = "debian/changelog"
license-file = ["LICENSE", "4"]
extended-description = """\
Terminal Network scanner & diagnostic tool with modern TUI (terminal user interface). \n
GitHub: https://github.com/Chleba/netscanner"""
assets = [
[
"target/release/netscanner",
"usr/bin/",
"4755",
],
[
"README.md",
"usr/share/doc/netscanner/README",
"644",
],
[
"debian/netscanner.manpage",
"usr/share/man/man1/netscanner.1",
"644",
],
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
better-panic = "0.3.0"
chrono = "0.4.31"
cidr = "0.2.2"
clap = { version = "4.4.5", features = ["derive", "cargo", "wrap_help", "unicode", "string", "unstable-styles"] }
clap = { version = "4.4.5", features = [
"derive",
"cargo",
"wrap_help",
"unicode",
"string",
"unstable-styles",
] }
color-eyre = "0.6.2"
config = "0.13.3"
crossterm = { version = "0.27.0", features = ["serde", "event-stream"] }
Expand Down
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
netscanner (0.5.1-1) stable; urgency=medium

* Initial release.

-- Dominic Orsi <dominic.orsi@gmail.com> Sun, 23 Jun 2024 17:25:30 -0700
29 changes: 29 additions & 0 deletions debian/netscanner.manpage
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.\" Manpage for netscanner.
.\" Contact dominic.orsi@gmail.com to correct errors or typos.
.TH man 1 "22 June 2024" "1.0" "netscanner man page"
.SH NAME
netscanner \- view and scan connected networks
.SH SYNOPSIS
.B netscanner
[\fIOPTION\fR]...
.SH DESCRIPTION
.B netscanner
is a terminal network scanner & diagnostic tool with modern TUI.
.SH OPTIONS
.TP
.BR \-t ", " \-\-tick\-rate " " \fIFLOAT\fR
Tick rate, i.e. number of ticks per second [default: 1]
.TP
.BR \-f ", " \-\-frame\-rate " " \fIFLOAT\fR
Frame rate, i.e. number of frames per second [default: 10]
.TP
.BR \-h ", " \-\-help
Print help
.TP
.BR \-V ", " \-\-version
Print version
.SH BUGS
See GitHub issues:
https://github.com/chleba/netscanner/issues
.SH AUTHOR
Dominic Orsi <dominic.orsi@gmail.com>

0 comments on commit 3c08596

Please sign in to comment.