-
Notifications
You must be signed in to change notification settings - Fork 7
219 lines (176 loc) · 7.65 KB
/
main.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
name: gw
on:
push:
pull_request:
env:
version: 1.1.0
jobs:
mingw:
strategy:
fail-fast: false
matrix:
sys: [ucrt64] # clang64,
name: ${{ matrix.sys }}
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
update: true
install: make
pacboy: toolchain:p glfw:p skia:p htslib:p freeglut:p glew:p ncurses:p fontconfig:p dlfcn:p libpng:p
- name: build
run: |
make
- name: upload
uses: actions/upload-artifact@v3
with:
name: mingw-${{ matrix.sys }}
path: ${{ github.workspace }}/*.exe
macos-package:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-14 ] # macos-12,
include:
- os: macos-12
arch: intel
- os: macos-14
arch: m1
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
brew install imagemagick graphicsmagick dylibbundler glfw fontconfig
# npm broken for python3.12 so use this as work around
brew list | grep python@
# brew unlink [email protected]
shopt -s expand_aliases
alias python=$(brew --prefix)/bin/python3.11
alias python3=$(brew --prefix)/bin/python3.11
sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.12
sudo rm -f /usr/local/bin/python3
sudo rm -f /Library/Frameworks/Python.framework/Versions/Current/bin/python
which python && python --version
which python3 && python --version
python -m pip install packaging
python3 -m pip install packaging
npm install --global create-dmg
- name: Build and install htslib with libdeflate
run: |
wget -O htslib.tar.bz2 https://github.com/samtools/htslib/releases/download/1.20/htslib-1.20.tar.bz2
tar -xvf htslib.tar.bz2 && mv htslib-* htslib && rm htslib.tar.bz2
git clone --depth 1 https://github.com/ebiggers/libdeflate.git
cd libdeflate && CFLAGS+=' -fPIC -O3 ' cmake -B build && CFLAGS+=' -fPIC -O3 ' cmake --build build
cp build/libdeflate.a ../htslib
cp libdeflate.h ../htslib
ls ../htslib
cd ../htslib
LDFLAGS="$LDFLAGS -L./" CPPFLAGS="$CPPFLAGS -I./" ./configure --enable-libcurl --enable-s3 --enable-lzma --enable-bz2 --with-libdeflate
make
sudo make install
- name: Make Prep
run: |
make prep
- name: package
run: |
osacompile -o gw.app deps/gw_applescript_prog.txt
cp deps/gw_droplet.icns gw.app/Contents/Resources/droplet.icns
echo "BUILDING GW"
brew_lib=$(brew --prefix)/lib
brew_include=$(brew --prefix)/include
brew_bin=$(brew --prefix)/bin
LDFLAGS="${LDFLAGS} -L${brew_lib}" CPPFLAGS="${CPPFLAGS} -I${brew_include}" make
mv gw ./gw.app/Contents/MacOS
rm -rf include lib src Makefile
PATH="$PATH:$brew_bin" dylibbundler -od -b -x ./gw.app/Contents/MacOS/gw -d ./gw.app/Contents/libs/ -p @executable_path/../libs/
echo "VALIDATION"
otool -L gw.app/Contents/MacOS/gw
echo ""
echo "CODE SIGNING"
ls -l
sudo chown -R $(whoami) ./gw.app
chmod -R a+rw ./gw.app
sudo codesign --remove-signature ./gw.app
sudo codesign --force --deep -s - gw.app -v
sudo codesign --verify -vvvv gw.app
PATH="$PATH:$brew_bin" create-dmg 'gw.app' || true
ls
mv gw\ undefined.dmg gw_macos_${{ matrix.arch }}.dmg
ls
pwd
- name: upload
uses: actions/upload-artifact@v3
with:
name: gw_macos_${{ matrix.arch }}
path: ./*.dmg
deb-package:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt update
sudo apt-get install dh-make build-essential debhelper dh-virtualenv
sudo apt-get install debugedit devscripts fakeroot debootstrap pbuilder autotools-dev
sudo apt install zlib1g-dev libbz2-dev liblzma-dev libncurses5-dev libncursesw5-dev libssl-dev
sudo apt install libgl1-mesa-dev libfontconfig-dev libcurl4-openssl-dev libglfw3 libglfw3-dev
- name: build
run: |
BUILD_DIR=$(pwd)
mkdir -p usr/bin
mkdir -p usr/lib/x86_64-linux-gnu
mkdir -p usr/lib/gwhts
mkdir -p usr/include/gwhts
mkdir -p usr/share/icons
mkdir -p usr/share/icons/hicolor/512x512/apps/
mkdir -p usr/share/applications
sudo mkdir -p /usr/lib/gwhts
sudo mkdir -p /usr/include/gwhts/htslib
sudo cp /usr/lib/x86_64-linux-gnu/libglfw* usr/lib/x86_64-linux-gnu/.
git clone --depth 1 https://github.com/ebiggers/libdeflate.git
cd libdeflate && CFLAGS+=' -fPIC -O3 ' cmake -B build && CFLAGS+=' -fPIC -O3 ' cmake --build build
sudo cp build/libdeflate.a /usr/local/lib && sudo cp libdeflate.h /usr/local/include
echo "LIBDEFLATE BUILT" && pwd
cd ${BUILD_DIR}
wget -O htslib.tar.bz2 https://github.com/samtools/htslib/releases/download/1.20/htslib-1.20.tar.bz2
tar -xvf htslib.tar.bz2
mv htslib-1.20 htslib && rm htslib.tar.bz2 && cd htslib
sed -i 's/ -g -Wall/ -Wall/' Makefile # strip debug information
./configure --enable-libcurl --enable-s3 --enable-lzma --enable-bz2 --with-libdeflate
make -j3
echo "HTSLIB BUILT" && pwd
cp -rf htslib ../include
sudo cp libhts.* /usr/lib/gwhts
sudo cp htslib/*.h /usr/include/gwhts/htslib
cp libhts.* ${BUILD_DIR}/usr/lib/gwhts
cd ${BUILD_DIR}
sed -i '133 i \\t-mv gw usr/bin' Makefile
sed -i 's@-L/usr/local/lib@-L/usr/local/lib -L/usr/lib/gwhts@g' Makefile
make prep
cp include/gw_icon.png usr/share/icons/
cp include/gw_icon.png usr/share/icons/hicolor/512x512/apps/
cp deps/gw.desktop usr/share/applications/
- name: package
run: |
dh_make --single --createorig --packagename gw_${version} --email [email protected] --yes --native
printf "usr/bin/gw\nusr/share/icons/gw_icon.png\nusr/share/applications/gw.desktop\nusr/lib/gwhts/\nusr/lib/x86_64-linux-gnu/libglfw.so.3\nusr/lib/x86_64-linux-gnu/libglfw.so.3.3" > debian/install
export LDFLAGS="$LDFLAGS -L./lib/skia/out/Release-x64 -L/usr/local/lib -L/usr/lib -L./usr/lib/gwhts -Wl,-rpath,'$ORIGIN/../lib/gwhts'"
sed -i '/^Section/c\Section: Bioinformatics' debian/control
sed -i '/^Homepage/c\Homepage: https://github.com/kcleal/gw' debian/control
sed -i '/^Description/c\Description: Genome browser and variant annotation' debian/control
sed -i '/<insert long/d' debian/control
printf "Conflicts: libglfw3 (<< 3.3)\nReplaces: libglfw3\n" >> debian/control
# Override dh_shlibdeps to include /usr/lib/gwhts
printf '#!/usr/bin/make -f\n%%:\n\tdh $@\n\nclean:\n\tdh_clean\n\noverride_dh_shlibdeps:\n\tdh_shlibdeps -l/usr/lib/gwhts\n' > debian/rules
chmod +x debian/rules
dpkg-buildpackage -us -uc
- name: upload
uses: actions/upload-artifact@v3
with:
name: debian-package
path: /home/runner/work/gw/*.deb