2020-12-11 14:24:42 +01:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-06-19 15:16:03 +02:00
|
|
|
branches: ["*"]
|
2020-12-11 14:24:42 +01:00
|
|
|
pull_request:
|
2022-06-23 23:48:02 +02:00
|
|
|
workflow_dispatch:
|
2020-12-11 14:24:42 +01:00
|
|
|
|
|
|
|
env:
|
|
|
|
BUILD_TYPE: Release
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
2022-01-15 00:14:12 +01:00
|
|
|
# Windows build
|
2021-01-10 14:22:34 +01:00
|
|
|
win:
|
2022-01-22 22:15:15 +01:00
|
|
|
runs-on: windows-2022
|
2022-03-27 00:01:28 +01:00
|
|
|
name: 🪟 Windows MINGW64
|
2020-12-11 14:24:42 +01:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: msys2 {0}
|
2021-09-19 21:49:09 +02:00
|
|
|
env:
|
|
|
|
CCACHE_DIR: "${{ github.workspace }}/.ccache"
|
|
|
|
CCACHE_MAXSIZE: "1000M"
|
|
|
|
CCACHE_COMPRESS: "true"
|
2020-12-11 14:24:42 +01:00
|
|
|
steps:
|
|
|
|
- name: 🧰 Checkout
|
2022-06-23 23:48:02 +02:00
|
|
|
uses: actions/checkout@v3
|
2020-12-11 14:24:42 +01:00
|
|
|
with:
|
2021-02-24 21:04:00 +01:00
|
|
|
submodules: recursive
|
2021-12-01 20:31:17 +01:00
|
|
|
|
2022-06-29 00:24:53 +02:00
|
|
|
- name: 📜 Prepare Cache
|
|
|
|
id: prep-ccache
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir -p "${CCACHE_DIR}"
|
|
|
|
echo "::set-output name=dir::$CCACHE_DIR"
|
|
|
|
|
|
|
|
- name: 📜 Restore ccache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
id: cache-ccache
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{ steps.prep-ccache.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
|
|
|
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build
|
|
|
|
|
|
|
|
- name: 📜 Restore CMakeCache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
build/CMakeCache.txt
|
|
|
|
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
|
|
|
|
2021-02-28 16:05:05 +01:00
|
|
|
- name: 🟦 Install msys2
|
2020-12-11 14:24:42 +01:00
|
|
|
uses: msys2/setup-msys2@v2
|
2021-12-01 20:31:17 +01:00
|
|
|
with:
|
|
|
|
msystem: mingw64
|
|
|
|
pacboy: >-
|
|
|
|
gcc:p
|
2022-01-13 21:31:01 +01:00
|
|
|
lld:p
|
2021-12-01 20:31:17 +01:00
|
|
|
cmake:p
|
|
|
|
make:p
|
|
|
|
ccache:p
|
|
|
|
glfw:p
|
|
|
|
file:p
|
|
|
|
mbedtls:p
|
|
|
|
python:p
|
|
|
|
freetype:p
|
|
|
|
dlfcn:p
|
2021-09-19 21:49:09 +02:00
|
|
|
|
2021-02-28 16:05:05 +01:00
|
|
|
- name: ⬇️ Install dependencies
|
2021-02-28 15:34:44 +01:00
|
|
|
run: |
|
2021-10-16 11:37:29 +02:00
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://win.rustup.rs > rustup-init.exe
|
|
|
|
./rustup-init.exe -y --default-host=x86_64-pc-windows-gnu --default-toolchain=none
|
|
|
|
rm rustup-init.exe
|
|
|
|
$USERPROFILE/.cargo/bin/rustup.exe target add x86_64-pc-windows-gnu
|
|
|
|
$USERPROFILE/.cargo/bin/rustup.exe default nightly
|
2021-09-19 21:49:09 +02:00
|
|
|
|
2022-08-04 21:50:41 +02:00
|
|
|
# Windows cmake build
|
2021-09-11 18:58:53 +02:00
|
|
|
- name: 🛠️ Build
|
2020-12-11 14:24:42 +01:00
|
|
|
run: |
|
2021-09-19 21:49:09 +02:00
|
|
|
mkdir -p build
|
2020-12-11 14:24:42 +01:00
|
|
|
cd build
|
2021-01-10 14:22:34 +01:00
|
|
|
# Get path to mingw python library
|
2021-06-07 22:42:56 +02:00
|
|
|
PYTHON_LIB_NAME=$(pkg-config --libs-only-l python3 | sed 's/^-l//' | sed 's/ //')
|
2021-01-10 14:22:34 +01:00
|
|
|
PYTHON_LIB_PATH=$(cygpath -m $(which lib${PYTHON_LIB_NAME}.dll))
|
|
|
|
|
2022-01-13 21:31:01 +01:00
|
|
|
cmake -G "MinGW Makefiles" \
|
|
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
|
|
|
|
-DCREATE_PACKAGE=ON \
|
|
|
|
-DPython_LIBRARY="$PYTHON_LIB_PATH" \
|
|
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
|
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
|
|
|
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
|
|
|
|
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
|
|
|
|
-DRUST_PATH="$USERPROFILE/.cargo/bin/" \
|
2022-07-18 20:02:12 +02:00
|
|
|
-DIMHEX_PATTERNS_PULL_MASTER=ON \
|
2021-01-10 14:22:34 +01:00
|
|
|
..
|
2021-09-19 21:49:09 +02:00
|
|
|
mingw32-make -j4 install
|
2021-01-10 14:22:34 +01:00
|
|
|
cpack
|
2022-08-01 14:51:08 +02:00
|
|
|
touch $PWD/install/PORTABLE
|
2021-10-16 11:37:29 +02:00
|
|
|
|
2021-09-11 18:58:53 +02:00
|
|
|
- name: ⬆️ Upload Portable ZIP
|
2022-06-23 23:48:02 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-01-10 14:22:34 +01:00
|
|
|
with:
|
2022-06-29 15:01:08 +02:00
|
|
|
name: Windows Portable
|
2021-01-10 14:22:34 +01:00
|
|
|
path: |
|
|
|
|
build/install/*
|
|
|
|
|
2021-09-11 18:58:53 +02:00
|
|
|
- name: ⬆️ Upload Windows Installer
|
2022-06-23 23:48:02 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-01-08 16:25:12 +01:00
|
|
|
with:
|
2021-01-10 14:22:34 +01:00
|
|
|
name: Windows Installer
|
2021-01-08 16:25:12 +01:00
|
|
|
path: |
|
2021-01-10 14:22:34 +01:00
|
|
|
build/*.msi
|
2020-12-11 14:24:42 +01:00
|
|
|
|
2022-01-15 00:14:12 +01:00
|
|
|
# MacOS build
|
2021-08-24 15:56:49 +02:00
|
|
|
macos:
|
2022-07-04 00:11:47 +02:00
|
|
|
runs-on: macos-11
|
|
|
|
name: 🍎 macOS 11.0
|
2021-01-25 15:09:30 +01:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: 🧰 Checkout
|
2022-06-23 23:48:02 +02:00
|
|
|
uses: actions/checkout@v3
|
2021-01-25 15:09:30 +01:00
|
|
|
with:
|
2021-02-24 21:04:00 +01:00
|
|
|
submodules: recursive
|
2022-06-29 00:24:53 +02:00
|
|
|
|
|
|
|
- name: 📜 Restore ccache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/Library/Caches/ccache
|
|
|
|
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
|
|
|
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build
|
|
|
|
|
|
|
|
|
|
|
|
- name: 📜 Restore CMakeCache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
build/CMakeCache.txt
|
|
|
|
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
2021-01-25 15:09:30 +01:00
|
|
|
|
|
|
|
- name: ⬇️ Install dependencies
|
|
|
|
run: |
|
|
|
|
brew bundle --no-lock --file dist/Brewfile
|
|
|
|
|
2022-08-04 21:50:41 +02:00
|
|
|
# MacOS cmake build
|
2021-09-11 18:58:53 +02:00
|
|
|
- name: 🛠️ Build
|
2021-01-25 15:09:30 +01:00
|
|
|
run: |
|
2021-09-19 21:49:09 +02:00
|
|
|
mkdir -p build
|
2021-01-25 15:09:30 +01:00
|
|
|
cd build
|
2022-06-25 12:19:59 +02:00
|
|
|
CC=$(brew --prefix gcc@12)/bin/gcc-12 \
|
|
|
|
CXX=$(brew --prefix gcc@12)/bin/g++-12 \
|
|
|
|
OBJC=$(brew --prefix llvm)/bin/clang \
|
|
|
|
OBJCXX=$(brew --prefix llvm)/bin/clang++ \
|
2021-02-02 23:11:23 +01:00
|
|
|
PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig":"$(brew --prefix)/lib/pkgconfig" \
|
2022-08-01 14:50:27 +02:00
|
|
|
MACOSX_DEPLOYMENT_TARGET="10.10" \
|
2022-06-25 12:19:59 +02:00
|
|
|
cmake \
|
|
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
|
|
|
-DCREATE_BUNDLE=ON \
|
|
|
|
-DCREATE_PACKAGE=ON \
|
|
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
|
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
|
|
|
-DCMAKE_OBJC_COMPILER_LAUNCHER=ccache \
|
|
|
|
-DCMAKE_OBJCXX_COMPILER_LAUNCHER=ccache \
|
2022-07-18 20:13:01 +02:00
|
|
|
-DIMHEX_PATTERNS_PULL_MASTER=ON \
|
2022-08-04 20:39:07 +02:00
|
|
|
-DCMAKE_OSX_DEPLOYMENT_TARGET="10.10" \
|
2021-02-02 23:11:23 +01:00
|
|
|
..
|
2021-09-19 21:49:09 +02:00
|
|
|
make -j4 package
|
2021-01-25 15:09:30 +01:00
|
|
|
|
2021-09-11 18:58:53 +02:00
|
|
|
- name: ⬆️ Upload DMG
|
2022-06-23 23:48:02 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-01-25 15:09:30 +01:00
|
|
|
with:
|
|
|
|
name: macOS DMG
|
|
|
|
path: build/*.dmg
|
2022-01-15 00:14:12 +01:00
|
|
|
|
2022-08-04 21:50:41 +02:00
|
|
|
# Ubuntu build
|
|
|
|
ubuntu:
|
2022-06-23 23:48:02 +02:00
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
name: 🐧 Ubuntu 22.04
|
2022-01-15 00:14:12 +01:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: 🧰 Checkout
|
2022-06-23 23:48:02 +02:00
|
|
|
uses: actions/checkout@v3
|
2022-01-15 00:14:12 +01:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: 📜 Restore cache
|
2022-06-23 23:48:02 +02:00
|
|
|
uses: actions/cache@v3
|
2022-01-15 00:14:12 +01:00
|
|
|
with:
|
|
|
|
path: |
|
2022-06-27 00:20:32 +02:00
|
|
|
~/.cache/ccache
|
2022-06-29 00:24:53 +02:00
|
|
|
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
|
|
|
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build
|
|
|
|
|
|
|
|
- name: 📜 Restore other caches
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
build/CMakeCache.txt
|
2022-01-15 00:14:12 +01:00
|
|
|
.flatpak-builder
|
|
|
|
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
2022-06-27 00:20:32 +02:00
|
|
|
|
2022-01-15 00:14:12 +01:00
|
|
|
- name: ⬇️ Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo rm -rf /usr/share/dotnet
|
|
|
|
sudo rm -rf /opt/ghc
|
|
|
|
sudo rm -rf "/usr/local/share/boost"
|
|
|
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
2022-01-22 22:10:49 +01:00
|
|
|
|
2022-01-15 00:14:12 +01:00
|
|
|
sudo apt update
|
|
|
|
sudo bash dist/get_deps_debian.sh
|
2022-03-20 23:43:55 +01:00
|
|
|
|
2022-08-04 21:50:41 +02:00
|
|
|
sudo apt install -y python3-pip python3-setuptools desktop-file-utils libgdk-pixbuf2.0-dev fuse
|
2022-03-20 23:43:55 +01:00
|
|
|
sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool
|
|
|
|
sudo chmod +x /usr/local/bin/appimagetool
|
2022-05-22 23:23:54 +02:00
|
|
|
sudo pip3 install appimage-builder==1.0.0
|
2022-01-22 22:10:49 +01:00
|
|
|
|
2022-01-15 00:14:12 +01:00
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
|
|
|
|
sh rustup-init.sh -y --default-toolchain none
|
|
|
|
rm rustup-init.sh
|
|
|
|
$HOME/.cargo/bin/rustup install nightly
|
|
|
|
$HOME/.cargo/bin/rustup target add x86_64-unknown-linux-gnu
|
|
|
|
$HOME/.cargo/bin/rustup default nightly
|
|
|
|
|
|
|
|
- name: 🛠️ Build
|
|
|
|
run: |
|
|
|
|
mkdir -p build
|
|
|
|
cd build
|
2022-06-25 12:19:59 +02:00
|
|
|
CC=gcc-12 CXX=g++-12 cmake \
|
2022-01-22 22:10:49 +01:00
|
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
2022-07-18 20:02:12 +02:00
|
|
|
-DCMAKE_INSTALL_PREFIX="/usr" \
|
2022-01-22 22:10:49 +01:00
|
|
|
-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/" \
|
2022-07-18 20:02:12 +02:00
|
|
|
-DIMHEX_PATTERNS_PULL_MASTER=ON \
|
2022-01-15 00:14:12 +01:00
|
|
|
..
|
2022-03-20 23:43:55 +01:00
|
|
|
make -j 4 install DESTDIR=AppDir
|
2022-01-15 00:14:12 +01:00
|
|
|
|
2022-06-29 15:01:08 +02:00
|
|
|
- name: 📜 Set version variable
|
|
|
|
run: |
|
2022-07-18 20:13:01 +02:00
|
|
|
echo "IMHEX_VERSION=`cat VERSION`" >> $GITHUB_ENV
|
2022-06-29 15:01:08 +02:00
|
|
|
|
2022-02-06 00:19:39 +01:00
|
|
|
#- name: 📦 Bundle Flatpak
|
|
|
|
# run: |
|
|
|
|
# sudo apt install flatpak flatpak-builder
|
|
|
|
# flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
|
|
# flatpak --user install -y flathub org.freedesktop.Platform//20.08
|
|
|
|
# flatpak --user install -y flathub org.freedesktop.Sdk//20.08
|
|
|
|
# flatpak-builder --jobs=4 --repo=imhex _flatpak dist/net.werwolv.ImHex.yaml --ccache --keep-build-dirs
|
|
|
|
# flatpak build-bundle imhex imhex.flatpak net.werwolv.ImHex stable
|
2022-01-15 00:14:12 +01:00
|
|
|
|
2022-03-20 23:43:55 +01:00
|
|
|
- name: 📦 Bundle DEB
|
|
|
|
run: |
|
|
|
|
cp -r build/DEBIAN build/AppDir
|
2022-08-05 19:45:01 +02:00
|
|
|
dpkg-deb -Zgzip --build build/AppDir
|
2022-07-18 20:13:01 +02:00
|
|
|
mv build/AppDir.deb imhex-${{env.IMHEX_VERSION}}.deb
|
2022-03-20 23:43:55 +01:00
|
|
|
rm -rf build/AppDir/DEBIAN
|
2022-01-15 00:14:12 +01:00
|
|
|
|
2022-08-04 20:37:57 +02:00
|
|
|
- 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
|
|
|
|
make -j 4 install DESTDIR=AppDir
|
|
|
|
|
2022-03-20 23:43:55 +01:00
|
|
|
- name: 📦 Bundle AppImage
|
|
|
|
run: |
|
|
|
|
cd build
|
|
|
|
appimage-builder --recipe ../dist/AppImageBuilder.yml
|
2022-07-18 20:13:01 +02:00
|
|
|
mv ImHex-AppImage-x86_64.AppImage ../imhex-${{env.IMHEX_VERSION}}.AppImage
|
2022-03-20 23:43:55 +01:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
#- name: ⬆️ Upload Flatpak
|
2022-06-23 23:48:02 +02:00
|
|
|
# uses: actions/upload-artifact@v3
|
2022-03-20 23:43:55 +01:00
|
|
|
# with:
|
|
|
|
# name: Linux Flatpak
|
|
|
|
# path: |
|
|
|
|
# imhex.flatpak
|
|
|
|
|
|
|
|
- name: ⬆️ Upload DEB
|
2022-06-23 23:48:02 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-01-15 00:14:12 +01:00
|
|
|
with:
|
2022-06-23 23:48:02 +02:00
|
|
|
name: Linux DEB (Ubuntu 22.04)
|
2022-06-29 15:01:08 +02:00
|
|
|
path: '*.deb'
|
2022-01-15 00:14:12 +01:00
|
|
|
|
|
|
|
- name: ⬆️ Upload AppImage
|
2022-06-23 23:48:02 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-01-15 00:14:12 +01:00
|
|
|
with:
|
|
|
|
name: Linux AppImage
|
2022-06-29 15:01:08 +02:00
|
|
|
path: '*.AppImage'
|
2022-01-22 22:10:49 +01:00
|
|
|
|
2022-08-04 21:50:41 +02:00
|
|
|
# ArchLinux build
|
2022-07-04 21:40:22 +02:00
|
|
|
archlinux-build:
|
|
|
|
name: 🐧 ArchLinux
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
container:
|
|
|
|
image: archlinux:base-devel
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: ⬇️ Update all packages
|
|
|
|
run: |
|
|
|
|
pacman -Syyu --noconfirm
|
|
|
|
|
|
|
|
- name: ⬇️ Install setup dependencies
|
|
|
|
run: |
|
|
|
|
pacman -Syu git ccache --noconfirm
|
|
|
|
|
|
|
|
- name: 🧰 Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: ⬇️ Install ImHex dependencies
|
|
|
|
run: |
|
|
|
|
dist/get_deps_archlinux.sh --noconfirm
|
|
|
|
|
|
|
|
- name: 📜 Restore ccache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/ccache
|
|
|
|
key: archlinux-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
|
|
|
restore-keys: archlinux-${{ secrets.CACHE_VERSION }}-build
|
|
|
|
|
|
|
|
- name: 📜 Restore CMakeCache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
build/CMakeCache.txt
|
|
|
|
key: archlinux-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
|
|
|
|
2022-08-04 21:50:41 +02:00
|
|
|
# ArchLinux cmake build
|
2022-07-04 21:40:22 +02:00
|
|
|
- name: 🛠️ Build
|
|
|
|
run: |
|
|
|
|
mkdir -p build
|
|
|
|
cd build
|
2022-07-18 20:02:12 +02:00
|
|
|
CC=gcc CXX=g++ cmake \
|
2022-07-04 21:40:22 +02:00
|
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
2022-08-04 21:50:41 +02:00
|
|
|
-DCMAKE_INSTALL_PREFIX="/usr" \
|
2022-07-04 21:40:22 +02:00
|
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
|
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
|
|
|
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
|
|
|
|
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
|
2022-08-04 21:50:41 +02:00
|
|
|
-DUSE_SYSTEM_CURL=ON \
|
|
|
|
-DUSE_SYSTEM_FMT=ON \
|
|
|
|
-DUSE_SYSTEM_YARA=ON \
|
|
|
|
-DUSE_SYSTEM_NLOHMANN_JSON=ON \
|
|
|
|
-DUSE_SYSTEM_CAPSTONE=OFF \
|
2022-07-18 20:13:01 +02:00
|
|
|
-DIMHEX_PATTERNS_PULL_MASTER=ON \
|
2022-07-04 21:40:22 +02:00
|
|
|
..
|
|
|
|
make -j 4 install DESTDIR=installDir
|
|
|
|
|
|
|
|
- name: 📜 Set version variable
|
|
|
|
run: |
|
2022-07-23 20:42:59 +02:00
|
|
|
echo "IMHEX_VERSION=`cat VERSION`" >> $GITHUB_ENV
|
2022-07-04 21:40:22 +02:00
|
|
|
|
|
|
|
- name: ✒️ Prepare PKGBUILD
|
|
|
|
run: |
|
|
|
|
cp dist/Arch/PKGBUILD build
|
2022-07-18 20:13:01 +02:00
|
|
|
sed -i 's/%version%/${{env.IMHEX_VERSION}}/g' build/PKGBUILD
|
2022-07-04 21:40:22 +02:00
|
|
|
|
|
|
|
# makepkg doesn't want to run as root, so I had to chmod 777 all over
|
|
|
|
- name: 📦 Package ArchLinux .pkg.tar.zst
|
|
|
|
run: |
|
|
|
|
cd build
|
|
|
|
|
|
|
|
# the name is a small trick to make makepkg recognize it as the source
|
|
|
|
# else, it would try to download the file from the release
|
2022-07-18 20:13:01 +02:00
|
|
|
tar -cvf imhex-${{env.IMHEX_VERSION}}-ArchLinux.pkg.tar.zst -C installDir .
|
2022-07-04 21:40:22 +02:00
|
|
|
|
|
|
|
chmod -R 777 .
|
|
|
|
|
|
|
|
sudo -u nobody makepkg
|
|
|
|
|
2022-07-31 17:29:57 +02:00
|
|
|
# Replace the old file
|
2022-07-18 20:13:01 +02:00
|
|
|
rm imhex-${{env.IMHEX_VERSION}}-ArchLinux.pkg.tar.zst
|
|
|
|
mv *.pkg.tar.zst imhex-${{env.IMHEX_VERSION}}-ArchLinux.pkg.tar.zst
|
2022-07-04 21:40:22 +02:00
|
|
|
|
|
|
|
- name: ⬆️ Upload imhex-archlinux.pkg.tar.zst
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ArchLinux .pkg.tar.zst
|
|
|
|
path: |
|
2022-07-18 20:13:01 +02:00
|
|
|
build/imhex-${{env.IMHEX_VERSION}}-ArchLinux.pkg.tar.zst
|
2022-08-04 21:50:41 +02:00
|
|
|
|
|
|
|
# Fedora build
|
2022-07-31 17:29:57 +02:00
|
|
|
fedora-build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- docker_image: fedora:latest
|
|
|
|
release: Latest
|
|
|
|
- docker_image: fedora:rawhide
|
|
|
|
release: Rawhide
|
|
|
|
|
|
|
|
|
|
|
|
name: 🐧 Fedora ${{ matrix.release }}
|
2022-07-31 00:43:42 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
container:
|
2022-07-31 17:29:57 +02:00
|
|
|
image: "${{ matrix.docker_image }}"
|
2022-07-31 00:43:42 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: ⬇️ Update all packages
|
|
|
|
run: |
|
|
|
|
dnf upgrade -y
|
|
|
|
|
|
|
|
- name: ⬇️ Install setup dependencies
|
|
|
|
run: |
|
|
|
|
dnf install -y \
|
|
|
|
ccache \
|
|
|
|
desktop-file-utils \
|
|
|
|
fmt-devel \
|
|
|
|
git \
|
|
|
|
json-devel \
|
|
|
|
libcurl-devel \
|
|
|
|
llvm-devel \
|
|
|
|
mbedtls-devel \
|
|
|
|
python3-devel \
|
|
|
|
rpm-build \
|
|
|
|
yara-devel
|
|
|
|
|
|
|
|
- name: 🧰 Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: ⬇️ Install ImHex dependencies
|
|
|
|
run: |
|
|
|
|
dist/get_deps_fedora.sh
|
|
|
|
|
|
|
|
- name: 📜 Restore ccache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/ccache
|
2022-07-31 17:29:57 +02:00
|
|
|
key: fedora-${{ matrix.release }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
|
|
|
restore-keys: fedora-${{ matrix.release }}-${{ secrets.CACHE_VERSION }}-build
|
2022-07-31 00:43:42 +02:00
|
|
|
|
|
|
|
- name: 📜 Restore CMakeCache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
2022-07-31 17:29:57 +02:00
|
|
|
~/rpmbuild/BUILDROOT/CMakeCache.txt
|
|
|
|
key: fedora-${{ matrix.release }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
2022-07-31 00:43:42 +02:00
|
|
|
|
|
|
|
- name: 📜 Set version variable
|
|
|
|
run: |
|
|
|
|
echo "IMHEX_VERSION=`cat VERSION`" >> $GITHUB_ENV
|
|
|
|
|
2022-08-04 21:50:41 +02:00
|
|
|
# Fedora cmake build (in imhex.spec)
|
2022-07-31 00:43:42 +02:00
|
|
|
- name: 📦 Build RPM
|
|
|
|
run: |
|
2022-07-31 17:29:57 +02:00
|
|
|
rpmbuild -ba --define "_version ${{env.IMHEX_VERSION}}" --define "_src_path $GITHUB_WORKSPACE" --define "_build_type $BUILD_TYPE" $GITHUB_WORKSPACE/dist/rpm/imhex.spec
|
2022-08-04 20:37:57 +02:00
|
|
|
mv ~/rpmbuild/RPMS/x86_64/*.rpm imhex-${{env.IMHEX_VERSION}}-Fedora-${{matrix.release}}.rpm
|
2022-07-31 00:43:42 +02:00
|
|
|
|
|
|
|
- name: ⬆️ Upload RPM
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2022-07-31 17:29:57 +02:00
|
|
|
name: Fedora ${{ matrix.release }} RPM
|
2022-07-31 00:43:42 +02:00
|
|
|
path: |
|
2022-08-04 20:37:57 +02:00
|
|
|
imhex-${{env.IMHEX_VERSION}}-Fedora-${{matrix.release}}.rpm
|