Skip to content

Commit f583fa9

Browse files
committed
gh-actions: Package DEB and RPM
Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent deb7c7a commit f583fa9

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

.github/workflows/package.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Build Linux Packages
2+
3+
on:
4+
push:
5+
# tags:
6+
# - 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-deb:
11+
name: Build .deb
12+
runs-on: ubuntu-24.04
13+
# env:
14+
# CARGO_NET_GIT_FETCH_WITH_CLI: true
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install dependencies
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install -y libudev-dev
22+
23+
- name: Setup Rust toolchain
24+
run: rustup show
25+
26+
- name: Install cargo-deb
27+
run: cargo install cargo-deb
28+
29+
- name: Build .deb package
30+
run: cargo deb -p framework_tool
31+
32+
- name: Upload .deb package
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: framework-tool-deb
36+
path: target/debian/*.deb
37+
38+
build-rpm:
39+
name: Build .rpm
40+
runs-on: ubuntu-24.04
41+
# env:
42+
# CARGO_NET_GIT_FETCH_WITH_CLI: true
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- name: Install dependencies
47+
run: |
48+
sudo apt-get update
49+
sudo apt-get install -y libudev-dev
50+
51+
- name: Setup Rust toolchain
52+
run: rustup show
53+
54+
- name: Install cargo-generate-rpm
55+
run: cargo install cargo-generate-rpm
56+
57+
- name: Build release binary
58+
run: cargo build -p framework_tool --release --features nvidia
59+
60+
- name: Strip binary
61+
run: strip -s target/release/framework_tool
62+
63+
- name: Build .rpm package
64+
run: cargo generate-rpm -p framework_tool
65+
66+
- name: Upload .rpm package
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: framework-tool-rpm
70+
path: target/generate-rpm/*.rpm

framework_tool/Cargo.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,32 @@ features = [
3333

3434
[package.metadata.winresource]
3535
LegalCopyright = "Framework Computer Inc © 2022"
36+
37+
[package.metadata.deb]
38+
name = "framework-tool"
39+
maintainer = "Framework Computer Inc <linux@frame.work>"
40+
depends = "libudev1"
41+
section = "utils"
42+
priority = "optional"
43+
features = ["nvidia"]
44+
assets = [
45+
["target/release/framework_tool", "usr/bin/", "755"],
46+
["../completions/bash/framework_tool", "usr/share/bash-completion/completions/framework_tool", "644"],
47+
["../completions/zsh/_framework_tool", "usr/share/zsh/site-functions/_framework_tool", "644"],
48+
["../completions/fish/framework_tool.fish", "usr/share/fish/vendor_completions.d/framework_tool.fish", "644"],
49+
["../LICENSE.md", "usr/share/doc/framework-tool/LICENSE.md", "644"],
50+
["../README.md", "usr/share/doc/framework-tool/README.md", "644"],
51+
]
52+
53+
[package.metadata.generate-rpm]
54+
assets = [
55+
{ source = "target/release/framework_tool", dest = "/usr/bin/framework_tool", mode = "755" },
56+
{ source = "../completions/bash/framework_tool", dest = "/usr/share/bash-completion/completions/framework_tool", mode = "644" },
57+
{ source = "../completions/zsh/_framework_tool", dest = "/usr/share/zsh/site-functions/_framework_tool", mode = "644" },
58+
{ source = "../completions/fish/framework_tool.fish", dest = "/usr/share/fish/vendor_completions.d/framework_tool.fish", mode = "644" },
59+
{ source = "../LICENSE.md", dest = "/usr/share/doc/framework-tool/LICENSE.md", mode = "644", doc = true },
60+
{ source = "../README.md", dest = "/usr/share/doc/framework-tool/README.md", mode = "644", doc = true },
61+
]
62+
63+
[package.metadata.generate-rpm.requires]
64+
systemd-libs = "*"

0 commit comments

Comments
 (0)