Skip to content

Commit cead7d5

Browse files
committed
pkg: add .deb package workflow
1 parent bb99076 commit cead7d5

File tree

7 files changed

+117
-15
lines changed

7 files changed

+117
-15
lines changed

.github/workflows/makefile.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,43 @@ on:
77
branches: [ "main", "test", "windows" ]
88

99
jobs:
10+
build-deb:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: create tmp directory
17+
run: mkdir /tmp/customfetch-0.8.6.orig
18+
19+
- name: Install Packages
20+
run: sudo apt-get update && sudo apt-get install libwayland-dev binutils lintian debhelper devscripts debmake autoconf automake autotools-dev dh-make fakeroot xutils pbuilder -y
21+
22+
- name: Clean
23+
run: make clean
24+
25+
- name: Create deb
26+
run: |
27+
cp -r $GITHUB_WORKSPACE /tmp/customfetch-0.8.6.orig
28+
cd /tmp/customfetch-0.8.6.orig/customfetch
29+
mkdir -p Debian/Debhelper/Buildsystem/
30+
wget https://github.com/Debian/debhelper/raw/master/lib/Debian/Debhelper/Buildsystem/makefile.pm -O Debian/Debhelper/Buildsystem/make.pm
31+
sed -i "s#package Debian::Debhelper::Buildsystem::makefile#package Debian::Debhelper::Buildsystem::make#g" Debian/Debhelper/Buildsystem/make.pm
32+
dpkg-buildpackage -us -uc
33+
34+
- name: Install test cufetch
35+
run: |
36+
cd /tmp/customfetch-0.8.6.orig
37+
sudo dpkg -i customfetch_0.8.6-1_amd64.deb
38+
cufetch
39+
1040
build_ubuntu-latest:
1141

1242
runs-on: ubuntu-latest
1343

1444
steps:
1545
- uses: actions/checkout@v4
16-
46+
1747
- name: Install Packages
1848
run: sudo apt-get update && sudo apt-get install build-essential cmake neofetch tree libgtk-3-dev pkg-config libgtkmm-3.0-dev libprocps-dev -y
1949

@@ -33,6 +63,7 @@ jobs:
3363
cat /sys/devices/virtual/dmi/id/board_name /sys/devices/virtual/dmi/id/board_vendor /sys/devices/virtual/dmi/id/board_version
3464
tree /sys/devices/system/cpu/cpu0/
3565
printf "/etc/os-release\n" && cat /etc/os-release
66+
printf "getting 0x5353 hexcode\n" && grep -nri "5353" /sys/class/ || true
3667
3768
- name: Test customfetch
3869
run: ./build/debug/cufetch
@@ -70,7 +101,7 @@ jobs:
70101

71102
- name: Test customfetch
72103
run: cufetch
73-
104+
74105
build_Arch:
75106

76107
runs-on: ubuntu-latest
@@ -81,7 +112,7 @@ jobs:
81112
- uses: actions/checkout@v4
82113

83114
- name: Install the packages
84-
run: pacman -Syyu git sudo base-devel fakeroot pkgconf tree neofetch fastfetch libprocps --noconfirm --needed
115+
run: pacman -Syyu git sudo binutils gdb base-devel fakeroot pkgconf tree neofetch fastfetch libprocps --noconfirm --needed
85116

86117
- name: get /etc/sudoers
87118
run: |
@@ -111,6 +142,9 @@ jobs:
111142
cat /sys/devices/virtual/dmi/id/board_name /sys/devices/virtual/dmi/id/board_vendor /sys/devices/virtual/dmi/id/board_version
112143
tree /sys/devices/system/cpu/cpu0/
113144
printf "/etc/os-release\n" && cat /etc/os-release
114-
145+
146+
#- name: Setup SSH session
147+
# uses: mxschmitt/action-tmate@v3
148+
115149
- name: Test customfetch
116150
run: ./build/debug/cufetch

.github/workflows/release.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ jobs:
2626
- uses: actions/checkout@v4
2727

2828
- name: Install Packages
29-
run: sudo apt-get update && sudo apt upgrade -y && sudo apt-get install build-essential -y
29+
run: |
30+
sudo apt-get update
31+
sudo apt upgrade -y
32+
sudo apt-get install build-essential libwayland-dev libarchive-tools -y
3033
3134
- name: Get submodules
3235
uses: actions/checkout@v4
@@ -46,7 +49,7 @@ jobs:
4649
uses: actions/upload-artifact@v3
4750
with:
4851
name: customfetch
49-
path: customfetch.tar.gz
52+
path: ./customfetch.tar.gz
5053

5154
build-gui:
5255
runs-on: ubuntu-latest
@@ -55,7 +58,10 @@ jobs:
5558
- uses: actions/checkout@v4
5659

5760
- name: Install Packages
58-
run: sudo apt-get update && sudo apt upgrade -y && sudo apt-get install build-essential libgtk-3-dev pkg-config libgtkmm-3.0-dev -y
61+
run: |
62+
sudo apt-get update
63+
sudo apt upgrade -y
64+
sudo apt-get install build-essential libwayland-dev libgtk-3-dev pkg-config libgtkmm-3.0-dev libarchive-tools -y
5965
6066
- name: Get submodules
6167
uses: actions/checkout@v4
@@ -69,13 +75,13 @@ jobs:
6975
run: make DEBUG=0 GUI_MODE=1
7076

7177
- name: Make Release
72-
run: make dist DEBUG=0 && mv ./customfetch-*.tar.gz ./customfetch-gui.tar.gz
78+
run: make dist DEBUG=0 GUI_MODE=1 && mv ./customfetch-*.tar.gz ./customfetch-gui.tar.gz
7379

7480
- name: Upload to github artifacts
7581
uses: actions/upload-artifact@v3
7682
with:
7783
name: customfetch-gui
78-
path: customfetch-gui.tar.gz
84+
path: ./customfetch-gui.tar.gz
7985

8086
release:
8187
name: Create GitHub Release
@@ -104,16 +110,17 @@ jobs:
104110
permissions:
105111
contents: write
106112
steps:
107-
- uses: actions/download-artifact@v4
108-
with:
109-
name: customfetch
113+
- uses: actions/download-artifact@v3
114+
115+
- name: tree that thing
116+
run: sudo apt install tree -y && tree
110117

111118
- uses: actions/upload-release-asset@v1
112119
env:
113120
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114121
with:
115122
upload_url: ${{ needs.release.outputs.release-url }}
116-
asset_path: ./customfetch.tar.gz
123+
asset_path: customfetch/customfetch.tar.gz
117124
asset_name: customfetch-${{ needs.get-version.outputs.version }}.tar.gz
118125
asset_content_type: application/tar+gz
119126

@@ -122,6 +129,6 @@ jobs:
122129
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123130
with:
124131
upload_url: ${{ needs.release.outputs.release-url }}
125-
asset_path: ./customfetch-gui.tar.gz
126-
asset_name: customfetch-${{ needs.get-version.outputs.version }}.tar.gz
132+
asset_path: customfetch-gui/customfetch-gui.tar.gz
133+
asset_name: customfetch-gui-${{ needs.get-version.outputs.version }}.tar.gz
127134
asset_content_type: application/tar+gz

debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
customfetch (0.8.6-1) unstable; urgency=medium
2+
3+
* Initial release
4+
5+
-- toni500 <[email protected]> Wed, 21 Aug 2024 11:46:42 -0500

debian/compat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
10

debian/control

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Source: customfetch
2+
Section: utils
3+
Priority: optional
4+
Maintainer: toni500 <[email protected]>
5+
Build-Depends: libwayland-dev
6+
Standards-Version: 4.5.1
7+
Homepage: https://github.com/Toni500github/customfetch
8+
9+
Package: customfetch
10+
Architecture: any
11+
Depends: ${shlibs:Depends}, ${misc:Depends}
12+
Description: Highly customizable and fast system information fetch program
13+
Inspired by neofetch and fastfetch

debian/copyright

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: customfetch
3+
Source: https://github.com/Toni500github/customfetch
4+
5+
Files: *
6+
Copyright: 2024 Toni500github
7+
License: GPL-3
8+
9+
Files: include/rapidxml-1.13/*
10+
Copyright: 2006 - 2009, Marcin Kalicinski
11+
License: MIT
12+
13+
Files: src/fmt/os.cc src/fmt/format.cc include/fmt/*
14+
Copyright: 2012 - present, Victor Zverovich
15+
License: MIT

debian/rules

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/make -f
2+
# See debhelper(7) (uncomment to enable)
3+
# output every command that modifies files on the build system.
4+
export DH_VERBOSE = 1
5+
6+
7+
# see FEATURE AREAS in dpkg-buildflags(1)
8+
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
9+
10+
# see ENVIRONMENT in dpkg-buildflags(1)
11+
# package maintainers to append CFLAGS
12+
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
13+
# package maintainers to append LDFLAGS
14+
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
15+
16+
17+
%:
18+
dh $@ --buildsystem=make
19+
20+
override_dh_auto_build:
21+
dh_auto_build -- all DEBUG=0 GUI_MODE=0
22+
23+
# dh_make generated override targets
24+
# This is example for Cmake (See https://bugs.debian.org/641051 )
25+
#override_dh_auto_configure:
26+
# dh_auto_configure -- \
27+
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

0 commit comments

Comments
 (0)