2020-12-11 13:24:42 +00:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
env:
|
|
|
|
BUILD_TYPE: Release
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
2020-12-18 20:44:13 +00:00
|
|
|
linux:
|
2020-12-11 13:24:42 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
name: 🐧 Ubuntu 20.04
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: 🧰 Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-02-24 20:04:00 +00:00
|
|
|
submodules: recursive
|
2020-12-11 13:24:42 +00:00
|
|
|
|
|
|
|
- name: ⬇️ Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2021-02-28 14:24:02 +00:00
|
|
|
sudo bash dist/get_deps_debian.sh
|
2020-12-11 13:24:42 +00:00
|
|
|
|
|
|
|
- name: ✋ Build
|
|
|
|
run: |
|
2021-02-01 16:26:05 +00:00
|
|
|
# Get path to magic db
|
|
|
|
MAGICDB_PATH=$(file --version | grep -oP "(?<=magic file from ).+")
|
|
|
|
|
2020-12-11 13:24:42 +00:00
|
|
|
mkdir build
|
|
|
|
cd build
|
2021-02-01 16:26:05 +00:00
|
|
|
CC=gcc-10 CXX=g++-10 cmake \
|
|
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
|
|
|
|
-DEXTRA_MAGICDBS="$MAGICDB_PATH" \
|
|
|
|
..
|
|
|
|
make -j 4 install
|
2020-12-11 13:24:42 +00:00
|
|
|
|
2021-01-10 23:44:20 +00:00
|
|
|
- name: 📦 Upload ELF
|
2021-01-08 15:25:12 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: Linux ELF
|
2021-02-01 16:26:05 +00:00
|
|
|
path: |
|
|
|
|
build/install/*
|
2021-01-08 15:25:12 +00:00
|
|
|
|
2021-01-10 13:22:34 +00:00
|
|
|
win:
|
2020-12-11 13:24:42 +00:00
|
|
|
runs-on: windows-latest
|
2021-02-28 14:24:02 +00:00
|
|
|
name: 🟦 Windows MINGW64
|
2020-12-11 13:24:42 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: msys2 {0}
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: 🧰 Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-02-24 20:04:00 +00:00
|
|
|
submodules: recursive
|
2020-12-11 13:24:42 +00:00
|
|
|
|
2020-12-21 10:54:33 +00:00
|
|
|
- name: ⬇️ Install dependencies
|
2020-12-11 13:24:42 +00:00
|
|
|
uses: msys2/setup-msys2@v2
|
2021-02-28 14:24:02 +00:00
|
|
|
run: |
|
|
|
|
bash dist/get_deps_msys2.sh
|
2020-12-11 13:24:42 +00:00
|
|
|
|
|
|
|
- name: ✋ Build
|
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2021-01-10 13:22:34 +00:00
|
|
|
# Get path to mingw python library
|
|
|
|
PYTHON_LIB_NAME=$(pkg-config --libs-only-l python3 | sed 's/^-l//')
|
|
|
|
PYTHON_LIB_PATH=$(cygpath -m $(which lib${PYTHON_LIB_NAME}.dll))
|
|
|
|
|
|
|
|
# Get path to magic db
|
|
|
|
MAGICDB_PATH=$(cygpath -m $(file --version | grep -oP "(?<=magic file from ).+"))
|
|
|
|
|
|
|
|
echo Python_LIBRARY: $PYTHON_LIB_PATH
|
|
|
|
echo MagicDB Path: $MAGICDB_PATH
|
|
|
|
|
|
|
|
cmake -G "MinGW Makefiles" \
|
|
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
|
|
|
|
-DCREATE_PACKAGE=ON \
|
|
|
|
-DPython_LIBRARY="$PYTHON_LIB_PATH" \
|
|
|
|
-DEXTRA_MAGICDBS="$MAGICDB_PATH" \
|
|
|
|
..
|
|
|
|
mingw32-make -j4
|
|
|
|
mingw32-make install
|
|
|
|
cpack
|
|
|
|
|
2021-01-10 23:44:20 +00:00
|
|
|
- name: 📦 Upload Portable ZIP
|
2021-01-10 13:22:34 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: Windows Portable ZIP
|
|
|
|
path: |
|
|
|
|
build/install/*
|
|
|
|
|
2021-01-10 23:44:20 +00:00
|
|
|
- name: 📦 Upload Windows Installer
|
2021-01-08 15:25:12 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2021-01-10 13:22:34 +00:00
|
|
|
name: Windows Installer
|
2021-01-08 15:25:12 +00:00
|
|
|
path: |
|
2021-01-10 13:22:34 +00:00
|
|
|
build/*.msi
|
2020-12-11 13:24:42 +00:00
|
|
|
|
2021-01-25 14:09:30 +00:00
|
|
|
macos-build:
|
|
|
|
runs-on: macos-11.0
|
|
|
|
name: 🍎 macOS 11.0
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: 🧰 Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-02-24 20:04:00 +00:00
|
|
|
submodules: recursive
|
2021-01-25 14:09:30 +00:00
|
|
|
|
|
|
|
- name: ⬇️ Install dependencies
|
|
|
|
run: |
|
|
|
|
brew bundle --no-lock --file dist/Brewfile
|
|
|
|
|
|
|
|
- name: ✋ Build
|
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2021-02-02 22:11:23 +00: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" \
|
|
|
|
cmake \
|
|
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
|
|
|
-DCREATE_BUNDLE=ON \
|
|
|
|
-DCREATE_PACKAGE=ON \
|
|
|
|
..
|
2021-01-25 14:09:30 +00:00
|
|
|
make -j 4 package
|
|
|
|
|
|
|
|
- name: 📦 Upload DMG
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: macOS DMG
|
|
|
|
path: build/*.dmg
|