Skip to content

Commit

Permalink
Issue-150 - rpm packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
morisja committed Nov 23, 2024
1 parent 81615a8 commit 1690992
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,35 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}


build-rpm-package:
runs-on: ubuntu-latest
container: debian:11

steps:
- uses: actions/checkout@v4
with:
path: clone
- name: Install dependencies
run: |
apt-get update
apt-get install -y build-essential dpkg-dev ca-certificates sudo curl
cd clone
apt-get build-dep -y .
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ github.event.schedule && 'nightly' || 'stable' }}
- name: Build package
run: |
debian/rules vendor
cargo generte-rpm
working-directory: clone
- uses: actions/upload-artifact@v3
with:
name: rpm-package
path: |
./*
!./clone/**
build-debian-package-11:
runs-on: ubuntu-latest
container: debian:11
Expand Down
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ num-traits = "^0.2"
sd-notify = "^0.4"
static_assertions = "1.1.0"
dns-lookup = "2.0.4"
cargo-generate-rpm = "0.15.2"

[dev-dependencies]
criterion = "^0.5"
Expand All @@ -33,3 +34,11 @@ temp-env = "^0.3"
[[bench]]
name = "user"
harness = false

[package.metadata.generate-rpm]
assets = [
{ source = "target/release/nsncd", dest = "/usr/bin/nsncd", mode = "0755" },
{ source = "debian/nsncd/lib/systemd/system/nsncd.service", dest = "/lib/systemd/system/nsncd.service", mode = "0644" },
{ source = "LICENSE", dest = "/usr/share/doc/nsncd/LICENSE", doc = true, mode = "0644" },
{ source = "README.md", dest = "/usr/share/doc/nsncd/README.md", doc = true, mode = "0644" }
]

0 comments on commit 1690992

Please sign in to comment.