Update build workflow to create Debian package and adjust release directory
All checks were successful
/ release (nightly) (push) Successful in 2m21s
All checks were successful
/ release (nightly) (push) Successful in 2m21s
This commit is contained in:
parent
86fc2c236e
commit
fbb62b9006
3 changed files with 18 additions and 9 deletions
|
@ -25,9 +25,14 @@ jobs:
|
||||||
cd /tmp/phenix
|
cd /tmp/phenix
|
||||||
mkdir -p /tmp/release
|
mkdir -p /tmp/release
|
||||||
tar -czf /tmp/release/phenix_${{ github.ref_name }}.tar.gz .
|
tar -czf /tmp/release/phenix_${{ github.ref_name }}.tar.gz .
|
||||||
|
- name: Make debian package
|
||||||
|
run: |
|
||||||
|
cargo install cargo-deb
|
||||||
|
cargo deb
|
||||||
|
cp target/debian/*.deb /tmp/release
|
||||||
- name: Make release
|
- name: Make release
|
||||||
uses: actions/forgejo-release@v2.6.0
|
uses: actions/forgejo-release@v2.6.0
|
||||||
with:
|
with:
|
||||||
direction: upload
|
direction: upload
|
||||||
release-dir: /tmp/phenix
|
release-dir: /tmp/release
|
||||||
token: ${{ secrets.FORGEJO_TOKEN }}
|
token: ${{ secrets.FORGEJO_TOKEN }}
|
12
Cargo.toml
12
Cargo.toml
|
@ -1,7 +1,13 @@
|
||||||
[package]
|
[package]
|
||||||
name = "phenix"
|
name = "phenix"
|
||||||
version = "0.1.2"
|
version = "0.1.3"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
license = "GPL-3.0-or-later"
|
||||||
|
repository="https://code.edgarpierre.fr/edpibu/phenix"
|
||||||
|
authors = ["edpibu <contact@edgarpierre.fr>"]
|
||||||
|
|
||||||
[dependencies]
|
[package.metadata.deb]
|
||||||
regex = "1.11.1"
|
maintainer-scripts = "debian/"
|
||||||
|
|
||||||
|
[package.metadata.deb.systemd-units]
|
||||||
|
unit-scripts = "."
|
||||||
|
|
|
@ -6,8 +6,7 @@ use std::io::Write;
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Reading kernel messages...");
|
println!("Reading kernel messages...");
|
||||||
|
|
||||||
let kmsg_file =
|
let kmsg_file = File::open_buffered("/dev/kmsg").expect("Failed to open /dev/kmsg");
|
||||||
File::open_buffered("/dev/kmsg").expect("Failed to open /dev/kmsg");
|
|
||||||
|
|
||||||
let lines = kmsg_file.lines();
|
let lines = kmsg_file.lines();
|
||||||
for line in lines {
|
for line in lines {
|
||||||
|
@ -43,8 +42,7 @@ fn echo1(path: String) {
|
||||||
match rm_file {
|
match rm_file {
|
||||||
Err(e) => println!("Failed to open remove file at {path}: {e}"),
|
Err(e) => println!("Failed to open remove file at {path}: {e}"),
|
||||||
Ok(mut file) => {
|
Ok(mut file) => {
|
||||||
file
|
file.write_all(b"1")
|
||||||
.write_all(b"1")
|
|
||||||
.expect("Failed to write to remove file");
|
.expect("Failed to write to remove file");
|
||||||
println!("Removed device {path}");
|
println!("Removed device {path}");
|
||||||
}
|
}
|
||||||
|
@ -53,4 +51,4 @@ fn echo1(path: String) {
|
||||||
|
|
||||||
fn rm_file_path(id: &str) -> String {
|
fn rm_file_path(id: &str) -> String {
|
||||||
format!("/sys/bus/pci/devices/{id}/remove")
|
format!("/sys/bus/pci/devices/{id}/remove")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue