]> git.r.bdr.sh - rbdr/blog/commitdiff
Add deb generator
authorRuben Beltran del Rio <redacted>
Wed, 13 Mar 2024 08:39:46 +0000 (09:39 +0100)
committerRuben Beltran del Rio <redacted>
Wed, 13 Mar 2024 08:39:46 +0000 (09:39 +0100)
.build.yml
Cargo.toml
Makefile

index 725c31b1cf5a7173c9fc19422b3c374f3a22c619..2673e478ec06c1fad9fe110099218359f22376eb 100644 (file)
@@ -23,6 +23,7 @@ tasks:
       make set_rust
   - install_builders: |
       cargo install cargo-generate-rpm
       make set_rust
   - install_builders: |
       cargo install cargo-generate-rpm
+      cargo install cargo-deb
   - package: |
       cd blog
       make ci
   - package: |
       cd blog
       make ci
index 881083812856c16ad10848d143452de961edc259..90215ed034679b8bdb080a085747275451f94d1c 100644 (file)
@@ -21,3 +21,9 @@ assets = [
     { source = "target/release/blog", dest = "/usr/bin/blog", mode = "755" },
     { source = "man/blog.1", dest = "/usr/share/man/man1/blog.1", mode = "644" },
 ]
     { source = "target/release/blog", dest = "/usr/bin/blog", mode = "755" },
     { source = "man/blog.1", dest = "/usr/share/man/man1/blog.1", mode = "644" },
 ]
+
+[package.metadata.deb]
+assets = [
+    { source = "target/release/blog", dest = "/usr/bin/blog", mode = "755" },
+    { source = "man/blog.1", dest = "/usr/share/man/man1/blog.1", mode = "644" },
+]
index 2591bc7741d05135bc45b42e0e917199773150e8..eba1bda2b71cbc8e69236a92e061b3c5b8658a3c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ prepare:
 build: prepare
        cargo build --profile $(profile) --target $(target)
 
 build: prepare
        cargo build --profile $(profile) --target $(target)
 
-release: rpm tar
+release: rpm tar dab
        @$(eval filename := $(app_name)-$(target)-$(channel))
 
 $(architectures):
        @$(eval filename := $(app_name)-$(target)-$(channel))
 
 $(architectures):
@@ -24,6 +24,14 @@ else
        $(MAKE) -e target=$@ build
 endif
 
        $(MAKE) -e target=$@ build
 endif
 
+deb: build
+       @$(eval filename := $(app_name)-$(target)-$(channel))
+       cargo deb --profile $(profile) --target $(target)
+       mv target/$(target)/deb/*.deb $(filename).deb
+       sha256sum $(filename).deb > $(filename).deb.sha256
+       rsync -avz $(filename).deb deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name)
+       rsync -avz $(filename).deb.sha256 deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name)
+
 rpm: build
        @$(eval filename := $(app_name)-$(target)-$(channel))
        cargo generate-rpm --profile $(profile) --target $(target)
 rpm: build
        @$(eval filename := $(app_name)-$(target)-$(channel))
        cargo generate-rpm --profile $(profile) --target $(target)