Skip to content

Commit 45c1e8f

Browse files
committed
workflow: fix release builds + merge both terminal and GUI app into a single tarball
1 parent 3e14cda commit 45c1e8f

File tree

3 files changed

+68
-93
lines changed

3 files changed

+68
-93
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -34,48 +34,29 @@ jobs:
3434
sudo apt-get update && sudo apt upgrade -y
3535
sudo apt-get install build-essential g++-11 libwayland-dev gettext libgtk-3-dev pkg-config libdconf-dev libglib2.0-dev libgtkmm-3.0-dev libarchive-tools -y
3636
37-
- name: Clean
38-
run: make distclean
39-
4037
- name: Compile
4138
run: make DEBUG=0 GUI_APP=0 CXX=x86_64-linux-gnu-g++-11
4239

43-
- name: Make Release
44-
run: make usr-dist DEBUG=0 && mv ./customfetch-*.tar.gz ./customfetch.tar.gz
40+
- name: Install to ./usr
41+
run: mkdir -p ./usr && make install DESTDIR=. PREFIX=/usr
4542

46-
- name: Upload to github artifacts
47-
uses: actions/upload-artifact@v4
48-
with:
49-
name: customfetch-linux
50-
path: ./customfetch.tar.gz
43+
- name: Compile (GUI app)
44+
run: make clean && make DEBUG=0 GUI_APP=1 CXX=x86_64-linux-gnu-g++-11
5145

52-
build-linux-tar-gui:
53-
runs-on: ubuntu-22.04
54-
permissions:
55-
contents: read
56-
57-
steps:
58-
- uses: actions/checkout@v4
59-
60-
- name: Install Packages
46+
- name: Install the GUI components
6147
run: |
62-
sudo apt-get update && sudo apt upgrade -y
63-
sudo apt-get install build-essential g++-11 libwayland-dev gettext libgtk-3-dev pkg-config libdconf-dev libglib2.0-dev libgtkmm-3.0-dev libarchive-tools -y
64-
65-
- name: Clean
66-
run: make clean
67-
68-
- name: Compile
69-
run: make DEBUG=0 GUI_APP=1 CXX=x86_64-linux-gnu-g++-11
48+
install ./build/release/customfetch-gui -Dm 755 -v ./usr/bin/
49+
mkdir -p ./usr/share/applications
50+
cp -f customfetch.desktop ./usr/share/applications/
7051
7152
- name: Make Release
72-
run: make usr-dist DEBUG=0 GUI_APP=1 && mv ./customfetch-*.tar.gz ./customfetch-gui.tar.gz
53+
run: tar -zcf ./customfetch.tar.gz ./usr/
7354

7455
- name: Upload to github artifacts
7556
uses: actions/upload-artifact@v4
7657
with:
77-
name: customfetch-gui-linux
78-
path: ./customfetch-gui.tar.gz
58+
name: customfetch-linux
59+
path: ./customfetch.tar.gz
7960

8061
build-deb:
8162
runs-on: ubuntu-22.04
@@ -84,7 +65,7 @@ jobs:
8465

8566
steps:
8667
- uses: actions/checkout@v4
87-
68+
8869
- name: create tmp directory
8970
run: mkdir /tmp/customfetch-2.0.0-beta1.orig
9071

@@ -121,7 +102,7 @@ jobs:
121102

122103
steps:
123104
- uses: actions/checkout@v4
124-
105+
125106
- name: create tmp directory
126107
run: mkdir /tmp/customfetch-2.0.0-beta1.orig
127108

@@ -161,14 +142,11 @@ jobs:
161142
- uses: actions/checkout@v4
162143

163144
- name: Install the packages
164-
run: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --overwrite fastfetch neofetch pkg-config tree llvm@19
145+
run: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --overwrite fastfetch neofetch pkg-config gtkmm3 tree llvm@19
165146

166147
- name: uname -a && clang++ --version
167148
run: uname -a && echo "\n" && $(brew --prefix llvm@19)/bin/clang++ --version
168149

169-
- name: Clean
170-
run: make distclean
171-
172150
- name: Compile and install
173151
run: |
174152
export CXX=$(brew --prefix llvm@19)/bin/clang++
@@ -177,53 +155,31 @@ jobs:
177155
make
178156
make install
179157
cd ..
180-
tar -zcf ./customfetch.tar.gz usr/
181-
182-
- name: Upload to github artifacts
183-
uses: actions/upload-artifact@v4
184-
with:
185-
if-no-files-found: error
186-
name: customfetch-macos
187-
path: ./customfetch.tar.gz
188158
189-
build-macos-tar-gui:
190-
runs-on: macos-latest
191-
permissions:
192-
contents: read
193-
194-
steps:
195-
- uses: actions/checkout@v4
196-
197-
- name: Install the packages
198-
run: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --overwrite fastfetch neofetch tree pkg-config gtkmm3 llvm@19
199-
200-
- name: uname -a && clang++ --version
201-
run: uname -a && echo "\n" && $(brew --prefix llvm@19)/bin/clang++ --version
202-
203-
- name: Clean
204-
run: make distclean
205-
206-
- name: Compile and install
159+
- name: Compile (GUI app)
207160
run: |
208161
export CXX=$(brew --prefix llvm@19)/bin/clang++
209162
export PKG_CONFIG_PATH="$(brew --prefix)/lib/pkgconfig:$(brew --prefix)/opt/gtkmm3/lib/pkgconfig:$(brew --prefix)/opt/gtk+3/lib/pkgconfig"
210-
mkdir build && cd build
163+
rm -rf build && mkdir build && cd build
211164
cmake .. -DCMAKE_BUILD_TYPE=Debug -DGUI_APP=1 -DCMAKE_INSTALL_PREFIX=../usr
212165
make
213-
make install
214-
cd ..
215-
tar -zcf ./customfetch-gui.tar.gz usr/
166+
mv -f customfetch-gui ../usr/bin/
167+
mkdir -p ../usr/share/applications
168+
mv -f ../customfetch.desktop ../usr/share/applications
169+
170+
- name: Make release
171+
run: tar -zcf ./customfetch.tar.gz usr/
216172

217173
- name: Upload to github artifacts
218174
uses: actions/upload-artifact@v4
219175
with:
220176
if-no-files-found: error
221-
name: customfetch-macos-gui
222-
path: ./customfetch-gui.tar.gz
177+
name: customfetch-macos
178+
path: ./customfetch.tar.gz
223179

224180
release:
225181
name: Create GitHub Release
226-
needs: [build-linux-tar, build-linux-tar-gui, build-macos-tar, build-macos-tar-gui, build-deb-gui, build-deb, get-version]
182+
needs: [build-linux-tar, build-macos-tar, build-deb-gui, build-deb, get-version]
227183
runs-on: ubuntu-latest
228184
permissions:
229185
contents: write
@@ -262,15 +218,6 @@ jobs:
262218
asset_name: customfetch-linux-${{ needs.get-version.outputs.version }}.tar.gz
263219
asset_content_type: application/tar+gz
264220

265-
- uses: actions/upload-release-asset@v1
266-
env:
267-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
268-
with:
269-
upload_url: ${{ needs.release.outputs.release-url }}
270-
asset_path: customfetch-linux-gui/customfetch-gui.tar.gz
271-
asset_name: customfetch-linux-gui-${{ needs.get-version.outputs.version }}.tar.gz
272-
asset_content_type: application/tar+gz
273-
274221
- uses: actions/upload-release-asset@v1
275222
env:
276223
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -280,15 +227,6 @@ jobs:
280227
asset_name: customfetch-macos-${{ needs.get-version.outputs.version }}.tar.gz
281228
asset_content_type: application/tar+gz
282229

283-
- uses: actions/upload-release-asset@v1
284-
env:
285-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
286-
with:
287-
upload_url: ${{ needs.release.outputs.release-url }}
288-
asset_path: customfetch-macos-gui/customfetch-gui.tar.gz
289-
asset_name: customfetch-maacos-gui-${{ needs.get-version.outputs.version }}.tar.gz
290-
asset_content_type: application/tar+gz
291-
292230
- uses: actions/upload-release-asset@v1
293231
env:
294232
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CMakeLists.txt

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,45 @@ add_library(cufetch SHARED
174174
)
175175

176176
set_target_properties(cufetch PROPERTIES
177-
VERSION 2.0.0-beta1
177+
VERSION 2.0.0
178178
SOVERSION 2
179179
OUTPUT_NAME "cufetch"
180180
POSITION_INDEPENDENT_CODE ON
181181
)
182182

183-
target_link_libraries(cufetch PUBLIC tiny-process-library)
184-
target_link_libraries(cufetch PUBLIC fmt)
183+
target_link_libraries(cufetch PUBLIC tiny-process-library fmt)
185184
target_link_libraries(${TARGET_NAME} PUBLIC cufetch)
186185

186+
# cufetchpm
187+
add_executable(cufetchpm
188+
cufetchpm/src/main.cpp
189+
cufetchpm/src/pluginManager.cpp
190+
cufetchpm/src/manifest.cpp
191+
cufetchpm/src/stateManager.cpp
192+
src/util.cpp
193+
src/libs/toml++/toml.cpp
194+
src/libs/getopt_port/getopt.c
195+
)
196+
197+
set_target_properties(cufetchpm PROPERTIES
198+
OUTPUT_NAME "cufetchpm"
199+
)
200+
201+
target_include_directories(cufetchpm PUBLIC
202+
cufetchpm/include
203+
../include
204+
../include/libs
205+
)
206+
207+
target_compile_definitions(cufetchpm PRIVATE
208+
VERSION="2.0.0-beta1"
209+
)
210+
211+
target_link_libraries(cufetchpm
212+
fmt
213+
tiny-process-library
214+
)
215+
187216
# locale
188217
add_custom_target(locale
189218
COMMAND ${CMAKE_SOURCE_DIR}/scripts/make_mo.sh ${CMAKE_SOURCE_DIR}/locale/
@@ -212,6 +241,10 @@ install(TARGETS ${TARGET_NAME}
212241
RUNTIME DESTINATION bin
213242
COMPONENT runtime)
214243

244+
install(TARGETS cufetchpm
245+
RUNTIME DESTINATION bin
246+
COMPONENT runtime)
247+
215248
# Create symlink
216249
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${TARGET_NAME} \${CMAKE_INSTALL_PREFIX}/bin/cufetch)")
217250

@@ -256,6 +289,7 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/locale/
256289
DESTINATION share/locale
257290
COMPONENT runtime)
258291

292+
if(NOT APPLE)
259293
install(CODE "
260294
execute_process(
261295
COMMAND ${CMAKE_COMMAND} -E create_symlink libcufetch.so.2 ${CMAKE_INSTALL_PREFIX}/lib/libcufetch.so
@@ -264,6 +298,7 @@ install(CODE "
264298
COMMAND ${CMAKE_COMMAND} -E create_symlink libcufetch.so.2.0.0 ${CMAKE_INSTALL_PREFIX}/lib/libcufetch.so.2
265299
)
266300
")
301+
endif()
267302

268303
install(CODE "
269304
execute_process(

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ USE_DCONF ?= 1
1414

1515
COMPILER := $(shell $(CXX) --version | head -n1)
1616

17-
ifeq ($(findstring GCC,$(COMPILER)),GCC)
17+
ifeq ($(findstring g++,$(COMPILER)),g++)
1818
export LTO_FLAGS = -flto=auto -ffat-lto-objects
1919
else ifeq ($(findstring clang,$(COMPILER)),clang)
2020
export LTO_FLAGS = -flto=thin
@@ -143,7 +143,9 @@ install: install-common $(TARGET)
143143
install $(BUILDDIR)/$(TARGET) -Dm 755 -v $(DESTDIR)$(PREFIX)/bin/$(TARGET)
144144
cd $(DESTDIR)$(PREFIX)/bin/ && ln -sf $(TARGET) cufetch
145145

146-
install-common: libcufetch locale
146+
install-common: genver libcufetch locale
147+
$(MAKE) -C cufetchpm DEBUG=$(DEBUG) GUI_APP=$(GUI_APP) CXXSTD=$(CXXSTD)
148+
install cufetchpm/$(BUILDDIR)/cufetchpm -Dm 755 -v $(DESTDIR)$(PREFIX)/bin/cufetchpm
147149
mkdir -p $(DESTDIR)$(MANPREFIX)/man1/
148150
sed -e "s/@VERSION@/$(VERSION)/g" -e "s/@BRANCH@/$(BRANCH)/g" < $(NAME).1 > $(DESTDIR)$(MANPREFIX)/man1/$(NAME).1
149151
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/$(NAME).1
@@ -154,7 +156,7 @@ install-common: libcufetch locale
154156
find locale/ -type f -exec install -Dm 644 "{}" "$(DESTDIR)$(PREFIX)/share/{}" \;
155157
mkdir -p $(DESTDIR)$(PREFIX)/include/libcufetch/
156158
cd include/libcufetch && find . -type f -exec install -Dm 644 "{}" "$(DESTDIR)$(PREFIX)/include/libcufetch/{}" \;
157-
install -Dm 755 $(BUILDDIR)/libcufetch.so $(DESTDIR)$(PREFIX)/lib/libcufetch.so.1
159+
cd $(BUILDDIR) && find . -name "libcufetch*" -exec install -Dm 755 "{}" "$(DESTDIR)$(PREFIX)/lib/{}" \;
158160
install -Dm 755 $(BUILDDIR)/libfmt.a $(DESTDIR)$(PREFIX)/lib/libcufetch-fmt.a
159161
ifeq ($(GUI_APP), 1)
160162
mkdir -p $(DESTDIR)$(APPPREFIX)

0 commit comments

Comments
 (0)