forked from WerWolv/ImHex
-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (135 loc) · 3.83 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Build
on:
push:
pull_request:
env:
BUILD_TYPE: Release
jobs:
linux:
runs-on: ubuntu-20.04
name: 🐧 Ubuntu 20.04
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-40
options: --privileged
steps:
- name: 🧰 Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: ⬇️ Install dependencies
run: |
sudo apt-get update
sudo bash dist/get_deps_debian.sh
- name: ✋ Build
run: |
# Get path to magic db
MAGICDB_PATH=$(file --version | grep -oP "(?<=magic file from ).+")
mkdir build
cd build
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
- name: ✋ Bundle Flatpak
uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
with:
bundle: imhex.flatpak
manifest-path: dist/net.werwolv.ImHex.yaml
cache-key: flatpak-builder-${{ github.sha }}
- name: 📦 Upload ELF
uses: actions/upload-artifact@v2
with:
name: Linux ELF
path: |
build/install/*
- name: 📦 Upload Flatpak
uses: actions/upload-artifact@v2
with:
name: Linux Flatpak
path: |
build/*.flatpak
win:
runs-on: windows-latest
name: 🟦 Windows MINGW64
defaults:
run:
shell: msys2 {0}
steps:
- name: 🧰 Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: 🟦 Install msys2
uses: msys2/setup-msys2@v2
- name: ⬇️ Install dependencies
run: |
bash dist/get_deps_msys2.sh
- name: ✋ Build
run: |
mkdir build
cd build
# Get path to mingw python library
PYTHON_LIB_NAME=$(pkg-config --libs-only-l python3 | sed 's/^-l//' | sed 's/ //')
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
- name: 📦 Upload Portable ZIP
uses: actions/upload-artifact@v2
with:
name: Windows Portable ZIP
path: |
build/install/*
- name: 📦 Upload Windows Installer
uses: actions/upload-artifact@v2
with:
name: Windows Installer
path: |
build/*.msi
macos:
if: false
runs-on: macos-11.0
name: 🍎 macOS 11.0
steps:
- name: 🧰 Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: ⬇️ Install dependencies
run: |
brew bundle --no-lock --file dist/Brewfile
- name: ✋ Build
run: |
mkdir build
cd build
CC=$(brew --prefix llvm)/bin/clang \
CXX=$(brew --prefix llvm)/bin/clang++ \
PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig":"$(brew --prefix)/lib/pkgconfig" \
MACOSX_DEPLOYMENT_TARGET="10.15" \
cmake \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCREATE_BUNDLE=ON \
-DCREATE_PACKAGE=ON \
..
make -j 4 package
- name: 📦 Upload DMG
uses: actions/upload-artifact@v2
with:
name: macOS DMG
path: build/*.dmg