2020-12-11 14:24:42 +01:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
env:
|
|
|
|
BUILD_TYPE: Release
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
2020-12-18 21:44:13 +01:00
|
|
|
linux:
|
2020-12-11 14:24:42 +01:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
name: 🐧 Ubuntu 20.04
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: 🧰 Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-02-24 21:04:00 +01:00
|
|
|
submodules: recursive
|
2021-12-01 20:31:17 +01:00
|
|
|
|
2021-09-19 21:49:09 +02:00
|
|
|
- name: 📜 Restore cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.ccache
|
|
|
|
.flatpak-builder
|
|
|
|
key: ${{ runner.os }}-build-${{ github.run_id }}
|
|
|
|
restore-keys: ${{ runner.os }}-build-
|
2020-12-11 14:24:42 +01:00
|
|
|
|
|
|
|
- name: ⬇️ Install dependencies
|
|
|
|
run: |
|
2021-08-25 15:02:25 +02:00
|
|
|
sudo apt update
|
2021-02-28 15:24:02 +01:00
|
|
|
sudo bash dist/get_deps_debian.sh
|
2021-12-01 20:31:17 +01:00
|
|
|
|
2021-10-16 11:37:29 +02: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
|
2020-12-11 14:24:42 +01:00
|
|
|
|
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-02-01 17:26:05 +01:00
|
|
|
CC=gcc-10 CXX=g++-10 cmake \
|
|
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
|
2021-09-19 21:49:09 +02:00
|
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
2021-10-16 11:37:29 +02:00
|
|
|
-DRUST_PATH="$HOME/.cargo/bin/" \
|
2021-02-01 17:26:05 +01:00
|
|
|
..
|
|
|
|
make -j 4 install
|
2020-12-11 14:24:42 +01:00
|
|
|
|
2021-09-11 18:58:53 +02:00
|
|
|
- name: 📦 Bundle Flatpak
|
2021-08-25 15:19:55 +02:00
|
|
|
run: |
|
|
|
|
sudo apt install flatpak flatpak-builder
|
|
|
|
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
2021-08-25 15:29:08 +02:00
|
|
|
flatpak --user install -y flathub org.freedesktop.Platform//20.08
|
|
|
|
flatpak --user install -y flathub org.freedesktop.Sdk//20.08
|
2021-09-19 21:49:09 +02:00
|
|
|
flatpak-builder --repo=imhex _flatpak dist/net.werwolv.ImHex.yaml --ccache --keep-build-dirs
|
2021-08-25 16:06:30 +02:00
|
|
|
flatpak build-bundle imhex imhex.flatpak net.werwolv.ImHex stable
|
2021-12-03 13:42:15 +01:00
|
|
|
|
|
|
|
- name: 📦 Bundle .deb
|
|
|
|
run: |
|
|
|
|
dpkg-deb --build build/install
|
2021-12-03 13:49:39 +01:00
|
|
|
mv build/install.deb imhex.deb
|
2021-12-03 13:42:15 +01:00
|
|
|
|
2021-09-11 18:58:53 +02:00
|
|
|
- name: ⬆️ Upload ELF
|
2021-01-08 16:25:12 +01:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: Linux ELF
|
2021-02-01 17:26:05 +01:00
|
|
|
path: |
|
|
|
|
build/install/*
|
2021-01-08 16:25:12 +01:00
|
|
|
|
2021-09-11 18:58:53 +02:00
|
|
|
- name: ⬆️ Upload Flatpak
|
2021-08-25 14:52:07 +02:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: Linux Flatpak
|
|
|
|
path: |
|
2021-08-25 16:06:30 +02:00
|
|
|
imhex.flatpak
|
2021-12-03 13:42:15 +01:00
|
|
|
|
|
|
|
- name: ⬆️ Upload .deb
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2021-12-03 13:49:39 +01:00
|
|
|
name: Linux DEB
|
2021-12-03 13:42:15 +01:00
|
|
|
path: |
|
|
|
|
imhex.deb
|
2021-01-10 14:22:34 +01:00
|
|
|
win:
|
2020-12-11 14:24:42 +01:00
|
|
|
runs-on: windows-latest
|
2021-02-28 15:24:02 +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
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-02-24 21:04:00 +01:00
|
|
|
submodules: recursive
|
2021-12-01 20:31:17 +01:00
|
|
|
|
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
|
|
|
|
cmake:p
|
|
|
|
make:p
|
|
|
|
ccache:p
|
|
|
|
capstone: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
|
|
|
|
|
|
|
- name: 📜 Prepare Cache
|
|
|
|
id: prep-ccache
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir -p "${CCACHE_DIR}"
|
|
|
|
echo "::set-output name=dir::$CCACHE_DIR"
|
|
|
|
|
|
|
|
- name: 📜 Restore Cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
id: cache-ccache
|
|
|
|
with:
|
|
|
|
path: ${{ steps.prep-ccache.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-build-${{ github.run_id }}
|
|
|
|
restore-keys: ${{ runner.os }}-build-
|
2020-12-11 14:24:42 +01:00
|
|
|
|
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))
|
|
|
|
|
|
|
|
cmake -G "MinGW Makefiles" \
|
|
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
|
|
|
|
-DCREATE_PACKAGE=ON \
|
|
|
|
-DPython_LIBRARY="$PYTHON_LIB_PATH" \
|
2021-09-19 21:49:09 +02:00
|
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
2021-10-16 11:37:29 +02:00
|
|
|
-DRUST_PATH="$USERPROFILE/.cargo/bin/" \
|
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
|
2021-10-16 11:37:29 +02:00
|
|
|
|
2021-09-11 18:58:53 +02:00
|
|
|
- name: ⬆️ Upload Portable ZIP
|
2021-01-10 14:22:34 +01:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: Windows Portable ZIP
|
|
|
|
path: |
|
|
|
|
build/install/*
|
|
|
|
|
2021-09-11 18:58:53 +02:00
|
|
|
- name: ⬆️ Upload Windows Installer
|
2021-01-08 16:25:12 +01:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
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
|
|
|
|
2021-08-24 15:56:49 +02:00
|
|
|
macos:
|
2021-01-25 15:09:30 +01:00
|
|
|
runs-on: macos-11.0
|
|
|
|
name: 🍎 macOS 11.0
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: 🧰 Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-02-24 21:04:00 +01:00
|
|
|
submodules: recursive
|
2021-01-25 15:09:30 +01:00
|
|
|
|
|
|
|
- name: ⬇️ Install dependencies
|
|
|
|
run: |
|
|
|
|
brew bundle --no-lock --file dist/Brewfile
|
|
|
|
|
2021-09-19 21:49:09 +02:00
|
|
|
- name: 📜 Restore cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.ccache
|
|
|
|
key: ${{ runner.os }}-build-${{ github.run_id }}
|
|
|
|
restore-keys: ${{ runner.os }}-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
|
2021-02-02 23:11:23 +01:00
|
|
|
CC=$(brew --prefix llvm)/bin/clang \
|
|
|
|
CXX=$(brew --prefix llvm)/bin/clang++ \
|
|
|
|
PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig":"$(brew --prefix)/lib/pkgconfig" \
|
2021-06-16 08:05:28 +02:00
|
|
|
MACOSX_DEPLOYMENT_TARGET="10.15" \
|
2021-02-02 23:11:23 +01:00
|
|
|
cmake \
|
|
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
|
|
|
-DCREATE_BUNDLE=ON \
|
|
|
|
-DCREATE_PACKAGE=ON \
|
2021-09-19 21:49:09 +02:00
|
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
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
|
2021-01-25 15:09:30 +01:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: macOS DMG
|
|
|
|
path: build/*.dmg
|