Skip to content

Commit

Permalink
git: Make sure Linux CI doesn't build ImHex twice (WerWolv#689)
Browse files Browse the repository at this point in the history
* install deb package in a different folder than AppImage

* added comment for Ubuntu cmake build

* fixed typos

* separate cmake build for deb and appimage
  • Loading branch information
iTrooz authored Aug 18, 2022
1 parent be82ee1 commit 6a88c7c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
40 changes: 23 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ jobs:
with:
submodules: recursive

- name: 📜 Restore cache
- name: 📜 Restore ccache
uses: actions/cache@v3
with:
path: |
Expand All @@ -200,6 +200,7 @@ jobs:
with:
path: |
build/CMakeCache.txt
build-appimage/CMakeCache.txt
.flatpak-builder
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}

Expand All @@ -225,21 +226,22 @@ jobs:
$HOME/.cargo/bin/rustup target add x86_64-unknown-linux-gnu
$HOME/.cargo/bin/rustup default nightly
# Ubuntu cmake build
- name: 🛠️ Build
run: |
mkdir -p build
cd build
CC=gcc-12 CXX=g++-12 cmake \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
-DRUST_PATH="$HOME/.cargo/bin/" \
-DIMHEX_PATTERNS_PULL_MASTER=ON \
..
make -j 4 install DESTDIR=AppDir
make -j 4 install DESTDIR=DebDir
- name: 📜 Set version variable
run: |
Expand All @@ -256,27 +258,31 @@ jobs:

- name: 📦 Bundle DEB
run: |
cp -r build/DEBIAN build/AppDir
dpkg-deb -Zgzip --build build/AppDir
mv build/AppDir.deb imhex-${{env.IMHEX_VERSION}}.deb
rm -rf build/AppDir/DEBIAN
cp -r build/DEBIAN build/DebDir
dpkg-deb -Zgzip --build build/DebDir
mv build/DebDir.deb imhex-${{env.IMHEX_VERSION}}.deb
# AppImage cmake build
- name: 🛠️ Reconfigure build for AppImage
run: |
# Reconfigure CMake to include a flag needed for AppImage
# Other flags are kept from old configuration
cd build
cmake \
-DIMHEX_PLUGINS_IN_SHARE=ON \
..
rm -rf AppDir
mkdir -p build-appimage
cd build-appimage
CC=gcc-12 CXX=g++-12 cmake \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
-DRUST_PATH="$HOME/.cargo/bin/" \
-DIMHEX_PATTERNS_PULL_MASTER=ON \
-DIMHEX_PLUGINS_IN_SHARE=ON \
..
make -j 4 install DESTDIR=AppDir
- name: 📦 Bundle AppImage
run: |
cd build
cd build-appimage
appimage-builder --recipe ../dist/AppImageBuilder.yml
mv ImHex-AppImage-x86_64.AppImage ../imhex-${{env.IMHEX_VERSION}}.AppImage
cd ..
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.20)
option(IMHEX_PLUGINS_IN_SHARE "Put the plugins in share/imhex/plugins instead of lib[..]/imhex/plugins" OFF)
option(IMHEX_STRIP_RELEASE "Strip the release builds" ON)
option(IMHEX_OFFLINE_BUILD "Enable offline build" OFF)
option(IMHEX_IGNORE_BAD_CLONE "Disabled the bad clone prevention checks" OFF)
option(IMHEX_IGNORE_BAD_CLONE "Disable the bad clone prevention checks" OFF)
option(IMHEX_PATTERNS_PULL_MASTER "Download latest files from master branch of the ImHex-Patterns repo" OFF)
option(IMHEX_IGNORE_BAD_COMPILER "Allow compiling with an unsupported compiler" OFF)

Expand Down

0 comments on commit 6a88c7c

Please sign in to comment.