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-10-10 20:37:00 +02:00
- name : 📜 Setup ccache
uses : hendrikmuhs/ccache-action@v1.2
2022-06-29 00:24:53 +02:00
id : cache-ccache
with :
key : ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
restore-keys : ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build
2022-10-10 20:37:00 +02:00
max-size : 50M
2022-06-29 00:24:53 +02:00
- 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
freetype:p
dlfcn:p
2021-09-19 21:49:09 +02:00
2022-10-27 14:12:46 +02:00
- name : 📜 Set version variable
run : |
echo "IMHEX_VERSION=`cat VERSION`" >> $GITHUB_ENV
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
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 \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
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
2023-01-12 08:25:28 +01:00
mv imhex-*.msi ../imhex-${{env.IMHEX_VERSION}}-Windows-x86_64.msi
2022-09-02 16:11:19 +02:00
echo "ImHex checks for the existence of this file to determine if it is running in portable mode. You should not delete this file" > $PWD/install/PORTABLE
2021-10-16 11:37:29 +02:00
2022-09-02 16:12:02 +02:00
- name : ⬆️ Upload Windows Installer
uses : actions/upload-artifact@v3
with :
2023-01-12 08:25:28 +01:00
name : Windows Installer x86_64
2022-09-02 16:12:02 +02:00
path : |
2023-01-12 08:25:28 +01:00
imhex-*.msi
2022-09-02 16:12:02 +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 :
2023-01-12 08:25:28 +01:00
name : Windows Portable x86_64
2021-01-10 14:22:34 +01:00
path : |
build/install/*
2022-09-02 16:12:02 +02:00
- name : ⬇️ Download Mesa3D for NoGPU version
shell : bash
run : |
echo "NoGPU version Powered by Mesa 3D : https://fdossena.com/?p=mesa%2Findex.frag" > build/install/MESA.md
2022-12-21 07:13:31 +01:00
curl https://werwolv.net/downloads/mesa/MesaForWindows-x64-latest.7z -L -o mesa.7z
2022-09-02 16:12:02 +02:00
7z e mesa.7z
mv opengl32.dll build/install
2022-10-28 09:17:04 +02:00
2022-09-02 16:12:02 +02:00
- name : ⬆️ Upload NoGPU Portable ZIP
2022-06-23 23:48:02 +02:00
uses : actions/upload-artifact@v3
2021-01-08 16:25:12 +01:00
with :
2023-01-12 08:25:28 +01:00
name : Windows Portable NoGPU x86_64
2021-01-08 16:25:12 +01:00
path : |
2022-09-02 16:12:02 +02:00
build/install/*
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
2021-01-25 15:09:30 +01:00
2022-08-30 09:47:39 +02:00
strategy :
matrix :
include :
- suffix : "-NoGPU"
custom_glfw : true
- suffix : ""
custom_glfw : false
name : 🍎 macOS 11.0${{matrix.suffix}}
steps :
2021-01-25 15:09:30 +01:00
- 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-08-30 09:47:39 +02:00
- name : 📜 Set version variable
run : |
echo "IMHEX_VERSION=`cat VERSION`" >> $GITHUB_ENV
2022-06-29 00:24:53 +02:00
2022-10-10 20:37:00 +02:00
- name : 📜 Setup ccache
uses : hendrikmuhs/ccache-action@v1.2
2022-06-29 00:24:53 +02:00
with :
2022-08-30 09:47:39 +02:00
key : ${{ runner.os }}-${{ matrix.suffix }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
2022-10-10 20:37:00 +02:00
restore-keys : ${{ runner.os }}-${{ matrix.suffix }}-${{ secrets.CACHE_VERSION }}-build
max-size : 50M
2022-06-29 00:24:53 +02:00
- name : 📜 Restore CMakeCache
uses : actions/cache@v3
with :
path : |
build/CMakeCache.txt
2022-08-30 09:47:39 +02:00
key : ${{ runner.os }}-${{ matrix.suffix }}-${{ 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-10-06 15:22:38 +02:00
rm -rf /usr/local/Cellar/capstone
2021-01-25 15:09:30 +01:00
2022-08-30 09:47:39 +02:00
- name : ⬇️ Install classic glfw
if : ${{! matrix.custom_glfw}}
run : |
brew install glfw
- name : 🧰 Checkout glfw
if : ${{matrix.custom_glfw}}
uses : actions/checkout@v3
with :
repository : glfw/glfw
path : glfw
- name : ⬇️ Patch and install custom glfw
if : ${{matrix.custom_glfw}}
run : |
cd glfw
git apply ../dist/macOS/0001-glfw-SW.patch
mkdir build
cd build
cmake \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_OBJC_COMPILER_LAUNCHER=ccache \
-DCMAKE_OBJCXX_COMPILER_LAUNCHER=ccache \
..
make -j 4 install
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" \
2023-01-12 08:25:28 +01:00
-DCPACK_PACKAGE_FILE_NAME="imhex-${{env.IMHEX_VERSION}}-macOS${{matrix.suffix}}-x86_64" \
2021-02-02 23:11:23 +01:00
..
2021-09-19 21:49:09 +02:00
make -j4 package
2022-10-28 09:14:01 +02: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 :
2023-01-12 08:25:28 +01:00
name : macOS DMG${{matrix.suffix}} x86_64
2021-01-25 15:09:30 +01:00
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
2022-10-10 20:37:00 +02:00
- name : 📜 Setup ccache
uses : hendrikmuhs/ccache-action@v1.2
2022-01-15 00:14:12 +01:00
with :
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
2022-10-10 20:37:00 +02:00
max-size : 50M
2022-06-29 00:24:53 +02:00
2023-01-12 23:50:59 +01:00
- name : 📜 Restore CMakeCache
2022-06-29 00:24:53 +02:00
uses : actions/cache@v3
with :
path : |
build/CMakeCache.txt
2022-01-15 00:14:12 +01:00
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 apt update
sudo bash dist/get_deps_debian.sh
2022-08-18 23:03:31 +02:00
# Ubuntu cmake build
2022-01-15 00:14:12 +01:00
- 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-08-18 23:03:31 +02:00
-DCMAKE_INSTALL_PREFIX="/usr" \
2022-01-22 22:10:49 +01:00
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
2022-07-18 20:02:12 +02:00
-DIMHEX_PATTERNS_PULL_MASTER=ON \
2022-11-25 10:40:07 +01:00
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
2022-01-15 00:14:12 +01:00
..
2022-08-18 23:03:31 +02:00
make -j 4 install DESTDIR=DebDir
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-03-20 23:43:55 +01:00
- name : 📦 Bundle DEB
run : |
2022-08-18 23:03:31 +02:00
cp -r build/DEBIAN build/DebDir
dpkg-deb -Zgzip --build build/DebDir
2023-01-12 08:25:28 +01:00
mv build/DebDir.deb imhex-${{env.IMHEX_VERSION}}-Ubuntu-22.04-x86_64.deb
2022-01-15 00:14:12 +01:00
2023-01-12 23:50:59 +01:00
- name : ⬆️ Upload DEB
uses : actions/upload-artifact@v3
with :
name : Ubuntu 22.04 DEB x86_64
path : '*.deb'
# AppImage build
appimage :
runs-on : ubuntu-22.04
name : ⬇️ AppImage
steps :
- name : 🧰 Checkout
uses : actions/checkout@v3
with :
submodules : recursive
- name : 📜 Setup ccache
uses : hendrikmuhs/ccache-action@v1.2
with :
2023-01-13 00:10:28 +01:00
key : ${{ runner.os }}-appimage-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
restore-keys : ${{ runner.os }}-appimage-${{ secrets.CACHE_VERSION }}-build
2023-01-12 23:50:59 +01:00
max-size : 50M
- name : 📜 Restore CMakeCache
uses : actions/cache@v3
with :
path : |
build-appimage/CMakeCache.txt
2023-01-13 00:10:28 +01:00
key : ${{ runner.os }}-appimage-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
2023-01-12 23:50:59 +01:00
- name : ⬇️ Install dependencies
run : |
sudo apt update
sudo bash dist/get_deps_debian.sh
sudo apt install -y python3-pip python3-setuptools desktop-file-utils libgdk-pixbuf2.0-dev fuse
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
sudo pip3 install git+https://github.com/iTrooz/appimage-builder@dpkg-package-versions
- name : 📜 Set version variable
run : |
echo "IMHEX_VERSION=`cat VERSION`" >> $GITHUB_ENV
2022-08-18 23:03:31 +02:00
# AppImage cmake build
2023-01-12 23:50:59 +01:00
- name : 🛠️ Build
2022-08-04 20:37:57 +02:00
run : |
2022-08-18 23:03:31 +02:00
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 \
-DIMHEX_PATTERNS_PULL_MASTER=ON \
2022-11-25 10:40:07 +01:00
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
2022-08-18 23:03:31 +02:00
-DIMHEX_PLUGINS_IN_SHARE=ON \
2022-08-26 00:21:17 +02:00
-DIMHEX_USE_BUNDLED_CA=ON \
2022-08-18 23:03:31 +02:00
..
2022-08-04 20:37:57 +02:00
make -j 4 install DESTDIR=AppDir
2022-03-20 23:43:55 +01:00
- name : 📦 Bundle AppImage
run : |
2022-08-18 23:03:31 +02:00
cd build-appimage
2022-09-08 09:31:49 +02:00
export VERSION=${{env.IMHEX_VERSION}}
2022-03-20 23:43:55 +01:00
appimage-builder --recipe ../dist/AppImageBuilder.yml
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 :
2023-01-12 08:25:28 +01:00
name : Linux AppImage x86_64
2022-09-08 09:31:49 +02:00
path : 'build-appimage/*.AppImage'
- name : ⬆️ Upload AppImage zsync
uses : actions/upload-artifact@v3
with :
2023-01-12 08:25:28 +01:00
name : Linux AppImage zsync x86_64
2022-09-08 09:31:49 +02:00
path : 'build-appimage/*.AppImage.zsync'
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
2022-10-10 20:37:00 +02:00
- name : 📜 Setup ccache
uses : hendrikmuhs/ccache-action@v1.2
2022-07-04 21:40:22 +02:00
with :
key : archlinux-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
restore-keys : archlinux-${{ secrets.CACHE_VERSION }}-build
2022-10-10 20:37:00 +02:00
max-size : 50M
2022-07-04 21:40:22 +02:00
- 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 \
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-11-25 10:40:07 +01:00
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=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
2023-01-12 08:25:28 +01:00
tar -cvf imhex-${{env.IMHEX_VERSION}}-ArchLinux-x86_64.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
2023-01-12 08:25:28 +01:00
rm imhex-${{env.IMHEX_VERSION}}-ArchLinux-x86_64.pkg.tar.zst
mv *.pkg.tar.zst imhex-${{env.IMHEX_VERSION}}-ArchLinux-x86_64.pkg.tar.zst
2022-07-04 21:40:22 +02:00
- name : ⬆️ Upload imhex-archlinux.pkg.tar.zst
uses : actions/upload-artifact@v3
with :
2023-01-12 08:25:28 +01:00
name : ArchLinux .pkg.tar.zst x86_64
2022-07-04 21:40:22 +02:00
path : |
2023-01-12 08:25:28 +01:00
build/imhex-${{env.IMHEX_VERSION}}-ArchLinux-x86_64.pkg.tar.zst
2022-08-04 21:50:41 +02:00
2023-01-10 23:10:34 +01:00
# RPM distro builds
rpm-build :
2022-07-31 17:29:57 +02:00
strategy :
matrix :
include :
2023-01-10 23:10:34 +01:00
- name : Fedora
mock_release : f37
release_num : 37
mock_config : fedora-37
- name : Fedora
mock_release : f36
release_num : 36
mock_config : fedora-36
- name : RHEL-AlmaLinux
mock_release : epel9
release_num : 9
mock_config : "alma+epel-9"
name : 🐧 ${{ matrix.name }} ${{ matrix.release_num }}
2022-07-31 00:43:42 +02:00
runs-on : ubuntu-latest
container :
2023-01-10 23:10:34 +01:00
image : "fedora:latest"
options : --privileged
2022-07-31 00:43:42 +02:00
steps :
2023-01-10 23:10:34 +01:00
- name : ⬇️ Install git-core
run : dnf install --disablerepo="*" --enablerepo="fedora" git-core -y
2022-07-31 00:43:42 +02:00
- name : 🧰 Checkout
uses : actions/checkout@v3
with :
2023-01-10 23:10:34 +01:00
path : ImHex
2022-07-31 00:43:42 +02:00
submodules : recursive
2023-01-10 23:10:34 +01:00
- name : 📜 Setup DNF Cache
uses : actions/cache@v3
with :
path : /var/cache/dnf
key : ${{ matrix.mock_release }}-${{secrets.CACHE_VERSION }}-dnf-${{ github.run_id }}
restore-keys : |
${{ matrix.mock_release }}-${{secrets.CACHE_VERSION }}-dnf-
- name : ⬇️ Update all packages and install dependencies
2022-07-31 00:43:42 +02:00
run : |
2023-01-10 23:10:34 +01:00
dnf upgrade --disablerepo="*" --enablerepo="fedora,updates" -y
dnf install --disablerepo="*" --enablerepo="fedora,updates" -y \
fedpkg \
ccache
2022-07-31 00:43:42 +02:00
2022-10-10 20:37:00 +02:00
- name : 📜 Setup ccache
2023-01-10 23:10:34 +01:00
uses : hendrikmuhs/ccache-action@v1.2.5
2022-07-31 00:43:42 +02:00
with :
2023-01-10 23:10:34 +01:00
key : rpm-${{ matrix.mock_release }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
restore-keys : rpm-${{ matrix.mock_release }}-${{ secrets.CACHE_VERSION }}-build
max-size : 1G
2022-07-31 00:43:42 +02:00
- name : 📜 Set version variable
run : |
2023-01-10 23:10:34 +01:00
echo "IMHEX_VERSION=`cat ImHex/VERSION`" >> $GITHUB_ENV
2022-07-31 00:43:42 +02:00
2023-01-10 23:10:34 +01:00
- name : 🗜️ Create tarball from sources with dependencies
run : tar --exclude-vcs -czf $GITHUB_WORKSPACE/imhex-$IMHEX_VERSION.tar.gz ImHex
- name : "✒️ Modify spec file: set version, use latest pattern language, enable online build"
run : |
sed -i \
-e 's/Version: [0-9]*\.[0-9]*\.[0-9]*$/Version : ${{env.IMHEX_VERSION}}/g' \
-e 's/IMHEX_OFFLINE_BUILD=ON/IMHEX_OFFLINE_BUILD=OFF/g' \
-e '/IMHEX_OFFLINE_BUILD=OFF/a -D IMHEX_PATTERNS_PULL_MASTER=ON \\' \
-e '/BuildRequires: cmake/a BuildRequires : git-core' \
-e '/%files/a %{_datadir}/%{name}/' \
$GITHUB_WORKSPACE/ImHex/dist/rpm/imhex.spec
- name : 📜 Fix ccache on EL9
if : matrix.mock_release == 'epel9'
run : sed -i '/\. \/opt\/rh\/gcc-toolset-12\/enable/a PATH=/usr/lib64/ccache:$PATH' $GITHUB_WORKSPACE/ImHex/dist/rpm/imhex.spec
- name : 🟩 Copy spec file to build root
run : mv $GITHUB_WORKSPACE/ImHex/dist/rpm/imhex.spec $GITHUB_WORKSPACE/imhex.spec
- name : 📜 Enable ccache for mock
run : |
cat <<EOT > $GITHUB_WORKSPACE/mock.cfg
include('${{ matrix.mock_config }}-x86_64.cfg')
config_opts['plugin_conf']['ccache_enable'] = True
config_opts['plugin_conf']['ccache_opts']['max_cache_size'] = '1G'
config_opts['plugin_conf']['ccache_opts']['compress'] = True
config_opts['plugin_conf']['ccache_opts']['dir'] = "$GITHUB_WORKSPACE/.ccache"
EOT
- name : 📜 Setup Mock Cache
uses : actions/cache@v3
with :
path : /var/cache/mock
key : ${{ matrix.mock_release }}-${{secrets.CACHE_VERSION }}-mock-${{ github.run_id }}
restore-keys : |
${{ matrix.mock_release }}-${{secrets.CACHE_VERSION }}-mock-
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 : |
2023-01-10 23:10:34 +01:00
fedpkg --path $GITHUB_WORKSPACE --release ${{ matrix.mock_release }} mockbuild --enable-network -N --root $GITHUB_WORKSPACE/mock.cfg extra_args -- -v
# set fortify_source back to 2 - level 3 in rawhide breaks through GH actions for some reason
2022-07-31 00:43:42 +02:00
2023-01-10 23:10:34 +01:00
- name : 🟩 Move and rename finished RPM
run : |
mv $GITHUB_WORKSPACE/results_imhex/${{env.IMHEX_VERSION}}/*/imhex-${{env.IMHEX_VERSION}}-0.*.x86_64.rpm \
$GITHUB_WORKSPACE/imhex-${{env.IMHEX_VERSION}}-${{matrix.name}}-${{matrix.release_num}}-x86_64.rpm
2022-07-31 00:43:42 +02:00
- name : ⬆️ Upload RPM
uses : actions/upload-artifact@v3
with :
2023-01-12 08:25:28 +01:00
name : ${{ matrix.name }} ${{ matrix.release_num }} RPM x86_64
2022-07-31 00:43:42 +02:00
path : |
2023-01-10 23:10:34 +01:00
imhex-${{env.IMHEX_VERSION}}-${{matrix.name}}-${{matrix.release_num}}-x86_64.rpm