-
Notifications
You must be signed in to change notification settings - Fork 51
185 lines (158 loc) · 5.67 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
name: Build binary release
on:
workflow_dispatch:
push:
branches:
- 'master'
tags:
- '*'
jobs:
linux_binary:
name: Build binary on Ubuntu 20.04
runs-on: ubuntu-20.04
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2
with:
path: focus-stack
fetch-depth: "0"
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install libopencv-dev build-essential debhelper devscripts
- name: Build binary, .deb and appimage
run: |
cd focus-stack
make
make builddeb
make build/focus-stack.AppImage
- name: Upload deb
uses: actions/upload-artifact@v2
with:
path: focus-stack/DEBUILD/*.deb
name: Focus-stack Ubuntu 20.04 package
- name: Upload ddeb
uses: actions/upload-artifact@v2
with:
path: focus-stack/DEBUILD/*.ddeb
name: Focus-stack Ubuntu 20.04 debug symbols
- name: Upload appimage
uses: actions/upload-artifact@v2
with:
path: focus-stack/build/focus-stack.AppImage
name: Focus-stack Linux x86_64 AppImage
mac_binary:
name: Build binary on Mac OS X 14
runs-on: macos-14
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2
with:
path: focus-stack
fetch-depth: "0"
- name: Install build dependencies
run: |
brew install opencv pkg-config dylibbundler
- name: Build binary
run: |
cd focus-stack
make
sudo make distrib/focus-stack_MacOSX.zip
- name: Upload binary
uses: actions/upload-artifact@v2
with:
path: focus-stack/distrib/focus-stack_MacOSX.zip
name: Focus-stack Mac OS X application
windows_binary:
name: Build binary on Windows 2022
runs-on: windows-2022
env:
VCPKG_BUILD_TYPE: release
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2
with:
path: focus-stack
fetch-depth: "0"
- name: Set vcpkg build type
shell: powershell
working-directory: C:\vcpkg\triplets
run: |
$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
echo "set(VCPKG_BUILD_TYPE release)" | Tee-Object -FilePath x64-windows-static.cmake -Append
echo "set(VCPKG_BUILD_TYPE release)" | Tee-Object -FilePath x64-windows.cmake -Append
echo "set(VCPKG_BUILD_TYPE release)" | Tee-Object -FilePath x86-windows-static.cmake -Append
echo "set(VCPKG_BUILD_TYPE release)" | Tee-Object -FilePath x86-windows.cmake -Append
cat x64-windows-static.cmake
cat x64-windows.cmake
- name: Cache dependencies
id: cache-vcpkg-1
uses: actions/cache@v2
with:
path: |
C:\Users\runneradmin\AppData\Local\vcpkg\archives
C:\vcpkg\installed
key: vcpkg-win2022-cache
- name: Install OpenCV dependency
shell: cmd
run: |
vcpkg install opencv:x64-windows
- name: Build binary
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd focus-stack
nmake -f Makefile.windows OPENCV_INC=C:\vcpkg\installed\x64-windows\include OPENCV_LIB=C:\vcpkg\installed\x64-windows\lib\opencv*.lib OPENCV_DLL=C:\vcpkg\installed\x64-windows\bin\*.dll
nmake -f Makefile.windows package
- name: Upload
uses: actions/upload-artifact@v2
with:
path: focus-stack/distrib/*.zip
name: Focus-stack Windows binary
- name: Upload debug symbols
uses: actions/upload-artifact@v2
with:
path: focus-stack/build/*.pdb
name: Focus-stack Windows debug symbols
release:
needs: [linux_binary, mac_binary, windows_binary]
runs-on: ubuntu-20.04
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2
with:
path: focus-stack
fetch-depth: "0"
- name: Download artifacts
run: |
mkdir -p focus-stack/distrib
cd focus-stack/distrib
gh run --repo ${GITHUB_REPOSITORY} download -n 'Focus-stack Mac OS X application'
gh run --repo ${GITHUB_REPOSITORY} download -n 'Focus-stack Ubuntu 20.04 package'
gh run --repo ${GITHUB_REPOSITORY} download -n 'Focus-stack Linux x86_64 AppImage'
gh run --repo ${GITHUB_REPOSITORY} download -n 'Focus-stack Windows binary'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: List artifacts
run: |
find focus-stack/distrib
- name: Upload to latest release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.ref == 'refs/heads/master'
run: |
cd focus-stack
git tag -d latest
git tag latest
git push origin --force latest
cd distrib
gh api repos/${GITHUB_REPOSITORY}/releases/tags/latest | jq -r '.assets[] | [.url] | @tsv' | xargs -n 1 gh api -X DELETE || true
gh release upload --repo ${GITHUB_REPOSITORY} --clobber latest *
- name: Upload to newly created release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
cd focus-stack/distrib
RELEASE=$(basename ${{github.ref}})
gh release upload --repo ${GITHUB_REPOSITORY} $RELEASE *