-
Notifications
You must be signed in to change notification settings - Fork 4
207 lines (175 loc) · 5.53 KB
/
release.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
name: ci
on:
push:
branches:
- master
paths-ignore:
- '**.md'
release:
types:
- published
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: set variables
run: |
if [[ ${{ github.event_name }} == 'release' ]]; then
echo "DIRNAME=lpt-${{ github.event.release.tag_name }}" >> $GITHUB_ENV
else
echo "DIRNAME=lpt-dev$(git rev-list HEAD --count)" >> $GITHUB_ENV
fi
- name: install build dependencies
run: |
sudo apt update
sudo apt install build-essential git gfortran liblapack-dev libgsl-dev \
minpack-dev f2c jhead zlib1g-dev libjpeg62-dev \
libceres-dev cmake
- name: clone vlfeat
run: |
git clone https://github.com/vlfeat/vlfeat.git
cd vlfeat
git checkout 1b9075f
cd -
- name: patch vlfeat
run: |
cp src/vlfeat/vl/pgm.patch vlfeat/vl
cd vlfeat/vl
patch < pgm.patch
- name: compile vlfeat
run: |
cd vlfeat
make
- name: clone bundler
run: |
git clone https://github.com/snavely/bundler_sfm.git
cd bundler_sfm
git checkout a35a8f5
cd -
- name: compile bundler
run: |
cd bundler_sfm
sed -i 's/# USE_CERES=true/USE_CERES=true/' src/Makefile
make
- name: remove files
run: |
cd bundler_sfm/bin
rm zlib1.dll
rm ToSift.sh
rm ToSiftList.sh
rm extract_focal.pl
- name: clone cmvs-pmvs
run: |
git clone https://github.com/pmoulon/CMVS-PMVS.git
cd CMVS-PMVS
git checkout 101c2ee
cd -
- name: compile cmvs-pmvs
run: |
cd CMVS-PMVS/program
mkdir build; cd build
cmake -G "CodeBlocks - Unix Makefiles" ..
make
- name: prepare files
run: |
cp vlfeat/bin/glnxa64/sift bundler_sfm/bin
cp vlfeat/bin/glnxa64/libvl.so bundler_sfm/bin
cp CMVS-PMVS/program/build/main/cmvs bundler_sfm/bin
cp CMVS-PMVS/program/build/main/pmvs2 bundler_sfm/bin
cp CMVS-PMVS/program/build/main/genOption bundler_sfm/bin
mkdir ${{ env.DIRNAME }}
cp -r bundler_sfm/bin ${{ env.DIRNAME }}
cp Makefile ${{ env.DIRNAME }}
cp LICENSE ${{ env.DIRNAME }}
cp vlfeat/COPYING ${{ env.DIRNAME }}/bin
cd ${{ env.DIRNAME }}
mkdir lib
mkdir -p examples/ET
mkdir -p examples/kermit
mv bin/libANN_char.so lib
mv bin/libvl.so lib
cd ..
cp -r cfg ${{ env.DIRNAME }}
cp -r docs ${{ env.DIRNAME }}
cp -r utils ${{ env.DIRNAME }}
cp bundler_sfm/examples/ET/*.jpg ${{ env.DIRNAME }}/examples/ET
cp bundler_sfm/examples/kermit/*.jpg ${{ env.DIRNAME }}/examples/kermit
- uses: actions/upload-artifact@v1
with:
name: ${{ env.DIRNAME }}
path: ${{ env.DIRNAME }}
test:
runs-on: ubuntu-18.04
needs: build
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: set variables
run: |
if [[ ${{ github.event_name }} == 'release' ]]; then
echo "DIRNAME=lpt-${{ github.event.release.tag_name }}" >> $GITHUB_ENV
else
echo "DIRNAME=lpt-dev$(git rev-list HEAD --count)" >> $GITHUB_ENV
fi
- name: install runtime dependencies
run: |
sudo apt update
sudo apt install build-essential libjpeg62 liblapack3 libceres1 jhead \
python3 python3-pil python3-ruamel.yaml
- uses: actions/download-artifact@v1
with:
name: ${{ env.DIRNAME }}
- name: run example
run: |
chmod -R u+x ${{ env.DIRNAME }}/bin
cd ${{ env.DIRNAME }}
make
release:
needs: test
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-18.04
steps:
- name: set variables
run: |
echo "DIRNAME=lpt-${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- uses: actions/download-artifact@v1
with:
name: ${{ env.DIRNAME }}
- name: tar
run: |
chmod -R u+x ${{ env.DIRNAME }}/bin
tar -zcvf ${{ env.DIRNAME }}.tar.gz ${{ env.DIRNAME }}
- name: release
uses: AButler/upload-release-assets@v2.0
with:
files: "*.tar.gz"
release-tag: ${{ github.event.release.tag_name }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
docker-push:
needs: release
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-18.04
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: epassaro
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: epassaro/linux-photogrammetry-tools:latest
build-args: |
VERSION=${{ github.event.release.tag_name }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}