-
Notifications
You must be signed in to change notification settings - Fork 8
182 lines (149 loc) · 6.49 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
name: gw
on:
push:
pull_request:
env:
version: 0.9.0
jobs:
mingw:
strategy:
fail-fast: false
matrix:
sys: [clang64, ucrt64]
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-intel:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
brew install graphicsmagick dylibbundler glfw fontconfig
# npm broken for python3.12 so use this as work around
brew list | grep python@
# brew unlink python@3.12
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: package
run: |
make prep
osacompile -o gw.app deps/gw_applescript_prog.txt
cp deps/gw_droplet.icns gw.app/Contents/Resources/droplet.icns
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 /usr/local/lib && cp libdeflate.h /usr/local/include && cd ../
wget -O htslib.tar.bz2 https://github.com/samtools/htslib/releases/download/1.18/htslib-1.18.tar.bz2
tar -xvf htslib.tar.bz2 && mv htslib-* htslib && rm htslib.tar.bz2 && cd htslib
./configure --enable-libcurl --enable-s3 --enable-lzma --enable-bz2 --with-libdeflate
make && make install && cd ../
echo "BUILDING GW"
make
mv gw ./gw.app/Contents/MacOS
rm -rf include lib src Makefile
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
codesign --remove-signature ./gw.app
codesign --force --deep -s - gw.app -v
codesign --verify -vvvv gw.app
create-dmg 'gw.app' || true
ls
mv gw\ undefined.dmg gw_${version}_macos_intel.dmg
- name: upload
uses: actions/upload-artifact@v3
with:
name: gw_macos_intel
path: /home/runner/work/gw/*.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 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/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.17/htslib-1.17.tar.bz2
tar -xvf htslib.tar.bz2
mv htslib-1.17 htslib && rm htslib.tar.bz2 && cd htslib
./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 '130 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 deps/gw.desktop usr/share/applications/
#cp -rf /usr/lib/gwhts usr/lib/gwhts
#cp -rf /usr/include/gwhts usr/include/gwhts
- name: package
run: |
dh_make --single --createorig --packagename gw_${version} --email clealk@cardiff.ac.uk --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
dpkg-buildpackage
- name: upload
uses: actions/upload-artifact@v3
with:
name: debian-package
path: /home/runner/work/gw/*.deb