Repository navigation
228 lines (192 loc) · 6.35 KB
/
Copy pathrelease.yml
File metadata and controls
228 lines (192 loc) · 6.35 KB
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
220
221
222
223
224
225
226
227
228
name: release
on:
push:
tags:
- "v*"
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
jobs:
ubuntu-x64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache apt packages
uses: actions/cache@v4
with:
path: /var/cache/apt/archives
key: apt-${{ runner.os }}-x64-${{ hashFiles('.github/workflows/release.yml') }}
restore-keys: apt-${{ runner.os }}-x64-
- name: Install build packages
run: |
sudo apt-get update
sudo apt-get install -y ninja-build ccache cmake
dpkg-query -W -f='${Package} ${Version}\n' ninja-build ccache cmake > /tmp/apt-fingerprint.txt
- name: ccache
uses: ggml-org/ccache-action@v1.2.21
with:
max-size: 500MB
evict-old-files: 7d
- name: Configure
run: >-
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_INSTALL_RPATH='$ORIGIN'
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
-DBUILD_SHARED_LIBS=OFF
- name: Build
run: cmake --build build -j"$(nproc)"
- name: Package
run: |
mkdir -p stage/bin
cp build/bin/dinov2-cli stage/bin/
tar -czf "dinov2-${{ github.ref_name }}-bin-ubuntu-x64.tar.gz" -C stage bin
- uses: actions/upload-artifact@v4
with:
name: dinov2-bin-linux-x64
path: dinov2-*-bin-ubuntu-x64.tar.gz
if-no-files-found: error
ubuntu-arm64:
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache apt packages
uses: actions/cache@v4
with:
path: /var/cache/apt/archives
key: apt-${{ runner.os }}-arm64-${{ hashFiles('.github/workflows/release.yml') }}
restore-keys: apt-${{ runner.os }}-arm64-
- name: Install build packages
run: |
sudo apt-get update
sudo apt-get install -y ninja-build ccache cmake
dpkg-query -W -f='${Package} ${Version}\n' ninja-build ccache cmake > /tmp/apt-fingerprint.txt
- name: ccache
uses: ggml-org/ccache-action@v1.2.21
with:
max-size: 500MB
evict-old-files: 7d
- name: Configure
run: >-
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_INSTALL_RPATH='$ORIGIN'
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
-DBUILD_SHARED_LIBS=OFF
- name: Build
run: cmake --build build -j"$(nproc)"
- name: Package
run: |
mkdir -p stage/bin
cp build/bin/dinov2-cli stage/bin/
tar -czf "dinov2-${{ github.ref_name }}-bin-ubuntu-arm64.tar.gz" -C stage bin
- uses: actions/upload-artifact@v4
with:
name: dinov2-bin-linux-arm64
path: dinov2-*-bin-ubuntu-arm64.tar.gz
if-no-files-found: error
macos-arm64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache brew formulas
uses: actions/cache@v4
with:
path: |
/usr/local/Cellar/ninja
/usr/local/Cellar/ccache
/opt/homebrew/Cellar/ninja
/opt/homebrew/Cellar/ccache
key: brew-${{ runner.os }}-${{ runner.arch }}-ninja-ccache
restore-keys: brew-${{ runner.os }}-${{ runner.arch }}-
- name: Install build packages
run: |
brew install ninja ccache blake3
brew link --overwrite ninja ccache
- name: ccache
uses: ggml-org/ccache-action@v1.2.21
with:
max-size: 500MB
evict-old-files: 7d
- name: Configure
run: >-
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_BUILD_RPATH='@loader_path'
-DCMAKE_OSX_DEPLOYMENT_TARGET=13.3
-DBUILD_SHARED_LIBS=OFF
- name: Build
run: cmake --build build -j"$(sysctl -n hw.logicalcpu)"
- name: Package
run: |
mkdir -p stage/bin
cp build/bin/dinov2-cli stage/bin/
tar -czf "dinov2-${{ github.ref_name }}-bin-macos-arm64.tar.gz" -C stage bin
- uses: actions/upload-artifact@v4
with:
name: dinov2-bin-macos-arm64
path: dinov2-*-bin-macos-arm64.tar.gz
if-no-files-found: error
windows-x64:
runs-on: windows-latest
env:
SCCACHE_GHA_ENABLED: "true"
SCCACHE_CACHE_SIZE: 500MB
CMAKE_C_COMPILER_LAUNCHER: sccache
CMAKE_CXX_COMPILER_LAUNCHER: sccache
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: sccache
uses: Mozilla-Actions/sccache-action@v0.0.9
- name: Configure
shell: pwsh
run: >-
cmake -B build -G "Ninja Multi-Config"
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=OFF
- name: Build
shell: pwsh
run: cmake --build build --config Release
- name: Package
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path stage/bin | Out-Null
Copy-Item build/bin/Release/dinov2-cli.exe stage/bin/
Compress-Archive -Path stage/bin -DestinationPath dinov2-bin-win-cpu-x64.zip
- uses: actions/upload-artifact@v4
with:
name: dinov2-bin-win-cpu-x64
path: dinov2-bin-win-cpu-x64.zip
if-no-files-found: error
release:
needs: [ubuntu-x64, ubuntu-arm64, macos-arm64, windows-x64]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
- name: Generate checksums
run: |
cd dist
sha256sum * > SHA256SUMS.txt
- name: Publish release
uses: softprops/action-gh-release@v2
with:
files: |
dist/**
generate_release_notes: true