Live video on the AT Protocol
1OUT_DIR?="bin"
2$(shell mkdir -p $(OUT_DIR))
3
4.PHONY: default
5default: streamplace
6
7VERSION?=$(shell go run ./pkg/config/git/git.go -v)
8VERSION_NO_V=$(subst v,,$(VERSION))
9VERSION_ELECTRON=$(subst -,-z,$(subst v,,$(VERSION)))
10UUID?=$(shell go run ./pkg/config/uuid/uuid.go)
11BRANCH?=$(shell go run ./pkg/config/git/git.go --branch)
12
13BUILDOS ?= $(shell uname -s | tr '[:upper:]' '[:lower:]')
14BUILDARCH ?= $(shell uname -m | tr '[:upper:]' '[:lower:]')
15ifeq ($(BUILDARCH),aarch64)
16 BUILDARCH=arm64
17endif
18ifeq ($(BUILDARCH),x86_64)
19 BUILDARCH=amd64
20endif
21MACOS_VERSION_FLAG=
22ifeq ($(BUILDOS),darwin)
23 MACOS_VERSION_FLAG=-mmacosx-version-min=$(shell sw_vers -productVersion)
24endif
25BUILDDIR?=build-$(BUILDOS)-$(BUILDARCH)
26PKG_CONFIG_PATH=$(shell pwd)/$(BUILDDIR)/lib/pkgconfig:$(shell pwd)/$(BUILDDIR)/lib/gstreamer-1.0/pkgconfig:$(shell pwd)/$(BUILDDIR)/meson-uninstalled
27
28.PHONY: version
29version:
30 @go run ./pkg/config/git/git.go -v \
31 && go run ./pkg/config/git/git.go --env -o .ci/build.env
32
33# _____ _____
34# /\ | __ \| __ \
35# / \ | |__) | |__) |
36# / /\ \ | ___/| ___/
37# / ____ \| | | |
38# /_/ \_\_| |_|
39
40# front-end stuff innit
41
42.PHONY: install
43install:
44 pnpm install
45
46.PHONY: app
47app: install
48 pnpm run build
49
50.PHONY: app-cached
51app-cached:
52 if [ ! -f js/app/dist/index.html ]; then $(MAKE) app; else echo "js/app/dist/index.html exists, not rebuilding, run make app to rebuild"; fi
53
54.PHONY: ci-ios
55ci-ios: version install app
56 $(MAKE) ios
57 $(MAKE) ci-upload-ios
58
59.PHONY: ci-android
60ci-android: version install android ci-upload-android
61
62.PHONY: ci-android-debug
63ci-android-debug: version install
64 pnpm run app prebuild
65 $(MAKE) android-debug
66 $(MAKE) ci-upload-android-debug
67
68.PHONY: ci-android-release
69ci-android-release: version install
70 pnpm run app prebuild
71 $(MAKE) android-release
72 $(MAKE) ci-upload-android-release
73
74
75ANDROID_KEYSTORE_PASSWORD?=streamplace
76ANDROID_KEYSTORE_ALIAS?=alias_name
77ANDROID_KEYSTORE_BASE64?=
78
79.PHONY: android-keystore
80android-keystore:
81 if [ -n "$$ANDROID_KEYSTORE_BASE64" ]; then \
82 echo "$$ANDROID_KEYSTORE_BASE64" | base64 -d > my-release-key.keystore; \
83 fi; \
84 if [ ! -f my-release-key.keystore ]; then \
85 keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 -storepass $(ANDROID_KEYSTORE_PASSWORD) -keypass $(ANDROID_KEYSTORE_PASSWORD) -dname "CN=Streamplace, OU=Streamplace, O=Streamplace, L=Streamplace, S=Streamplace, C=US"; \
86 fi
87
88.PHONY: android
89android: app .build/bundletool.jar
90 $(MAKE) android-release
91 $(MAKE) android-debug
92
93.PHONY: android-release
94android-release: .build/bundletool.jar android-keystore
95 export NODE_ENV=production \
96 && cd ./js/app/android \
97 && ./gradlew :app:bundleRelease \
98 && cd - \
99 && mv ./js/app/android/app/build/outputs/bundle/release/app-release.aab ./bin/streamplace-$(VERSION)-android-release.aab \
100 && cd bin \
101 && java -jar ../.build/bundletool.jar build-apks --ks ../my-release-key.keystore --ks-key-alias alias_name --ks-pass pass:$(ANDROID_KEYSTORE_PASSWORD) --bundle=streamplace-$(VERSION)-android-release.aab --output=streamplace-$(VERSION)-android-release.apks --mode=universal \
102 && unzip streamplace-$(VERSION)-android-release.apks && mv universal.apk streamplace-$(VERSION)-android-release.apk && rm toc.pb
103
104.PHONY: android-debug
105android-debug: .build/bundletool.jar android-keystore
106 export NODE_ENV=production \
107 && cd ./js/app/android \
108 && ./gradlew :app:bundleDebug \
109 && cd - \
110 && mv ./js/app/android/app/build/outputs/bundle/debug/app-debug.aab ./bin/streamplace-$(VERSION)-android-debug.aab \
111 && cd bin \
112 && java -jar ../.build/bundletool.jar build-apks --ks ../my-release-key.keystore --ks-key-alias alias_name --ks-pass pass:$(ANDROID_KEYSTORE_PASSWORD) --bundle=streamplace-$(VERSION)-android-debug.aab --output=streamplace-$(VERSION)-android-debug.apks --mode=universal \
113 && unzip streamplace-$(VERSION)-android-debug.apks && mv universal.apk streamplace-$(VERSION)-android-debug.apk && rm toc.pb
114
115.PHONY: ios
116ios: app
117 xcodebuild \
118 -workspace ./js/app/ios/Streamplace.xcworkspace \
119 -sdk iphoneos \
120 -configuration Release \
121 -scheme Streamplace \
122 -archivePath ./bin/streamplace-$(VERSION)-ios-release.xcarchive \
123 CODE_SIGN_IDENTITY=- \
124 AD_HOC_CODE_SIGNING_ALLOWED=YES \
125 CODE_SIGN_STYLE=Automatic \
126 DEVELOPMENT_TEAM=ZZZZZZZZZZ \
127 clean archive | xcpretty \
128 && cd bin \
129 && tar -czvf streamplace-$(VERSION)-ios-release.xcarchive.tar.gz streamplace-$(VERSION)-ios-release.xcarchive
130
131# _____ ____
132# / ____|/ __ \
133# | | __| | | |
134# | | |_ | | | |
135# | |__| | |__| |
136# \_____|\____/
137
138.PHONY: rtcrec
139rtcrec:
140 go build -o $(BUILDDIR)/rtcrec ./pkg/rtcrec/cmd/...
141
142# __ __ ______ _____ ____ _ _
143# | \/ | ____|/ ____|/ __ \| \ | |
144# | \ / | |__ | (___ | | | | \| |
145# | |\/| | __| \___ \| | | | . ` |
146# | | | | |____ ____) | |__| | |\ |
147# |_| |_|______|_____/ \____/|_| \_|
148
149BASE_OPTS = \
150 --buildtype=debugoptimized \
151 -D "gst-plugins-base:audioresample=enabled" \
152 -D "gst-plugins-base:playback=enabled" \
153 -D "gst-plugins-base:opus=enabled" \
154 -D "gst-plugins-base:gio-typefinder=enabled" \
155 -D "gst-plugins-base:videotestsrc=enabled" \
156 -D "gst-plugins-base:videoconvertscale=enabled" \
157 -D "gst-plugins-base:typefind=enabled" \
158 -D "gst-plugins-base:compositor=enabled" \
159 -D "gst-plugins-base:videorate=enabled" \
160 -D "gst-plugins-base:app=enabled" \
161 -D "gst-plugins-base:audiorate=enabled" \
162 -D "gst-plugins-base:audiotestsrc=enabled" \
163 -D "gst-plugins-base:audioconvert=enabled" \
164 -D "gst-plugins-good:matroska=enabled" \
165 -D "gst-plugins-good:multifile=enabled" \
166 -D "gst-plugins-good:rtp=enabled" \
167 -D "gst-plugins-bad:fdkaac=enabled" \
168 -D "gst-plugins-good:audioparsers=enabled" \
169 -D "gst-plugins-good:isomp4=enabled" \
170 -D "gst-plugins-good:png=enabled" \
171 -D "gst-plugins-good:videobox=enabled" \
172 -D "gst-plugins-good:jpeg=enabled" \
173 -D "gst-plugins-good:audioparsers=enabled" \
174 -D "gst-plugins-bad:videoparsers=enabled" \
175 -D "gst-plugins-bad:mpegtsmux=enabled" \
176 -D "gst-plugins-bad:mpegtsdemux=enabled" \
177 -D "gst-plugins-bad:codectimestamper=enabled" \
178 -D "gst-plugins-bad:opus=enabled" \
179 -D "gst-plugins-ugly:x264=enabled" \
180 -D "gst-plugins-ugly:gpl=enabled" \
181 -D "x264:asm=enabled" \
182 -D "gstreamer-full:gst-full=enabled" \
183 -D "gstreamer-full:gst-full-plugins=libgstopusparse.a;libgstcodectimestamper.a;libgstrtp.a;libgstaudioresample.a;libgstlibav.a;libgstmatroska.a;libgstmultifile.a;libgstjpeg.a;libgstaudiotestsrc.a;libgstaudioconvert.a;libgstaudioparsers.a;libgstfdkaac.a;libgstisomp4.a;libgstapp.a;libgstvideoconvertscale.a;libgstvideobox.a;libgstvideorate.a;libgstpng.a;libgstcompositor.a;libgstaudiorate.a;libgstx264.a;libgstopus.a;libgstvideotestsrc.a;libgstvideoparsersbad.a;libgstaudioparsers.a;libgstmpegtsmux.a;libgstmpegtsdemux.a;libgstplayback.a;libgsttypefindfunctions.a;libgstcoretracers.a;libgstcodec2json.a" \
184 -D "gstreamer-full:gst-full-libraries=gstreamer-controller-1.0,gstreamer-plugins-base-1.0,gstreamer-pbutils-1.0" \
185 -D "gstreamer-full:gst-full-elements=coreelements:concat,filesrc,filesink,queue,queue2,multiqueue,typefind,tee,capsfilter,fakesink,identity" \
186 -D "gstreamer-full:bad=enabled" \
187 -D "gstreamer-full:tls=disabled" \
188 -D "gstreamer-full:libav=enabled" \
189 -D "gstreamer-full:ugly=enabled" \
190 -D "gstreamer-full:gpl=enabled" \
191 -D "gstreamer-full:gst-full-typefind-functions=" \
192 -D "gstreamer:coretracers=enabled" \
193 -D "gstreamer-full:glib_assert=false" \
194 -D "gstreamer:glib_assert=false" \
195 -D "gst-plugins-good:glib_assert=false" \
196 -D "gst-plugins-bad:glib_assert=false" \
197 -D "gst-plugins-base:glib_assert=false" \
198 -D "gst-plugins-ugly:glib_assert=false" \
199 -D "glib:glib_assert=false" \
200 -D "glib:glib_assert=false" \
201 -D "gst-libav:glib_assert=false" \
202 -D "gst-plugins-good:adaptivedemux2=disabled" \
203 -D "gst-plugins-bad:codec2json=enabled"
204
205STATIC_OPTS = \
206 $(BASE_OPTS) \
207 -D "gstreamer-full:gst-full-target-type=static_library" \
208 -D "gstreamer:registry=false"
209
210SHARED_OPTS = \
211 $(BASE_OPTS) \
212 -D "FFmpeg:default_library=shared" \
213 -D "gstreamer:registry=true"
214
215.PHONY: meson
216meson:
217 $(MAKE) meson-setup
218 $(MAKE) meson-compile
219
220MESON_SETUP_OPTS?=
221.PHONY: meson-setup
222meson-setup:
223 @meson setup $(BUILDDIR) $(MESON_SETUP_OPTS)
224 @meson configure $(BUILDDIR) $(OPTS)
225
226.PHONY: meson-setup-static
227meson-setup-static:
228 @meson setup $(BUILDDIR) $(MESON_SETUP_OPTS) $(STATIC_OPTS)
229 @meson configure $(BUILDDIR) $(STATIC_OPTS)
230
231.PHONY: meson-compile
232meson-compile:
233 meson install -C $(BUILDDIR)
234
235
236# _____ _______ _______ _____ _____
237# / ____|__ __|/\|__ __|_ _/ ____|
238# | (___ | | / \ | | | || |
239# \___ \ | | / /\ \ | | | || |
240# ____) | | |/ ____ \| | _| || |____
241# |_____/ |_/_/ \_\_| |_____\_____|
242
243# Production distributions of Streamplace with bundled node and app.
244
245static:
246 $(MAKE) meson-setup meson-compile app OPTS=$(STATIC_OPTS) -j16
247 $(MAKE) streamplace
248
249.PHONY: static-test
250static-test:
251 go install github.com/jstemmer/go-junit-report/v2@latest \
252 && PKG_CONFIG_PATH=$(shell realpath $(BUILDDIR)/meson-uninstalled) \
253 bash -euo pipefail -c "go test -p 1 -timeout 300s ./pkg/... -v | tee /dev/stderr | go-junit-report -out test.xml"
254
255# _____ ________ __
256# | __ \| ____\ \ / /
257# | | | | |__ \ \ / /
258# | | | | __| \ \/ /
259# | |__| | |____ \ /
260# |_____/|______| \/
261
262# Local builds of Streamplace with node and app.
263
264.PHONY: dev-setup
265dev-setup:
266 $(MAKE) -j16 app-cached dev-setup-meson
267
268.PHONY: dev
269dev: app-cached
270 if [ ! -d $(BUILDDIR) ]; then $(MAKE) dev-setup; fi
271 cp ./util/streamplace-dev.sh $(BUILDDIR)/streamplace
272 $(MAKE) dev-rust
273 PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) \
274 CGO_LDFLAGS="$(MACOS_VERSION_FLAG)" \
275 LD_LIBRARY_PATH=$(BUILDDIR)/lib go build -o $(BUILDDIR)/libstreamplace ./cmd/libstreamplace/...
276
277.PHONY: dev-setup-meson
278dev-setup-meson:
279 $(MAKE) dev-setup-meson-configure
280 $(MAKE) meson-compile
281
282.PHONY: dev-setup-meson-configure
283dev-setup-meson-configure:
284 if ! which uniffi-bindgen-go; then cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.3.0+v0.28.3; fi
285 meson setup --default-library=shared $(BUILDDIR) $(SHARED_OPTS)
286 meson configure --default-library=shared $(BUILDDIR) $(SHARED_OPTS)
287
288.PHONY: dev-rust
289dev-rust:
290 cargo build
291 EXT=so; \
292 if [ "$(BUILDOS)" = "darwin" ]; then EXT=dylib; fi; \
293 uniffi-bindgen-go --out-dir pkg/iroh/generated --library ./target/debug/libiroh_streamplace.$$EXT \
294 && cp ./target/debug/libiroh_streamplace.$$EXT $(BUILDDIR)/rust/iroh-streamplace/libiroh_streamplace.$$EXT \
295 && cp ./target/debug/libiroh_streamplace.$$EXT $(BUILDDIR)/lib/libiroh_streamplace.$$EXT
296
297.PHONY: dev-test
298dev-test:
299 go install github.com/jstemmer/go-junit-report/v2@latest \
300 && PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) \
301 LD_LIBRARY_PATH=$(shell realpath $(BUILDDIR))/lib \
302 bash -euo pipefail -c "go test -p 1 -timeout 300s ./pkg/... -v | tee /dev/stderr | go-junit-report -out test.xml"
303
304# _ _____ _ _ _______ _____ _ _ _____
305# | | |_ _| \ | |__ __|_ _| \ | |/ ____|
306# | | | | | \| | | | | | | \| | | __
307# | | | | | . ` | | | | | | . ` | | |_ |
308# | |____ _| |_| |\ | | | _| |_| |\ | |__| |
309# |______|_____|_| \_| |_| |_____|_| \_|\_____|
310
311.PHONY: check
312check: install
313 $(MAKE) golangci-lint
314 pnpm run check
315 if [ "`gofmt -l . | wc -l`" -gt 0 ]; then echo 'gofmt failed, run make fix'; exit 1; fi
316 RUSTFLAGS="-D warnings" cargo check
317
318.PHONY: fix
319fix:
320 pnpm run fix
321 gofmt -w .
322 cargo fix --allow-dirty
323
324.PHONY: golangci-lint
325golangci-lint:
326 @PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) \
327 go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint run -c ./.golangci.yaml
328
329# _ ________ _______ _____ ____ _ _ _____
330# | | | ____\ \ / /_ _/ ____/ __ \| \ | |/ ____|
331# | | | |__ \ V / | || | | | | | \| | (___
332# | | | __| > < | || | | | | | . ` |\___ \
333# | |____| |____ / . \ _| || |___| |__| | |\ |____) |
334# |______|______/_/ \_\_____\_____\____/|_| \_|_____/
335
336# Mostly codegen for lexicons.
337
338.PHONY: lexicons
339lexicons:
340 $(MAKE) go-lexicons \
341 && $(MAKE) js-lexicons \
342 && $(MAKE) md-lexicons \
343 && make fix
344
345.PHONY: go-lexicons
346go-lexicons:
347 rm -rf ./pkg/streamplace \
348 && mkdir -p ./pkg/streamplace \
349 && rm -rf ./pkg/streamplace/cbor_gen.go \
350 && $(MAKE) lexgen \
351 && sed -i.bak 's/\tutil/\/\/\tutil/' $$(find ./pkg/streamplace -type f) \
352 && go run golang.org/x/tools/cmd/goimports@latest -w $$(find ./pkg/streamplace -type f) \
353 && go run ./pkg/gen/gen.go \
354 && $(MAKE) lexgen \
355 && find . | grep bak$$ | xargs rm \
356 && rm -rf api
357
358.PHONY: js-lexicons
359js-lexicons:
360 node_modules/.bin/lex gen-api ./js/streamplace/src/lexicons $$(find ./lexicons -type f -name '*.json') --yes \
361 && rm -rf ./js/streamplace/src/lexicons/types/com ./js/streamplace/src/lexicons/types/app \
362 && sed -i.bak "s/^..port.*app\/bsky.*//g" $$(find ./js/streamplace/src/lexicons -type f) \
363 && sed -i.bak "s/^..port.*com\/atproto.*//g" $$(find ./js/streamplace/src/lexicons -type f) \
364 && sed -i.bak "s/\(..port .*\)\.js\(.*\)/\1\2/g" $$(find ./js/streamplace/src/lexicons -type f) \
365 && sed -i.bak 's/AppBskyGraphBlock\.Main/AppBskyGraphBlock\.Record/' $$(find ./js/streamplace/src/lexicons/types/place/stream -type f) \
366 && sed -i.bak 's/PlaceStreamChatProfile\.Main/PlaceStreamChatProfile\.Record/' $$(find ./js/streamplace/src/lexicons/types/place/stream -type f) \
367 && for x in $$(find ./js/streamplace/src/lexicons -type f -name '*.ts'); do \
368 echo 'import { AppBskyRichtextFacet, AppBskyGraphBlock, ComAtprotoRepoStrongRef, AppBskyActorDefs, ComAtprotoSyncListRepos, AppBskyActorGetProfile, AppBskyFeedGetFeedSkeleton, ComAtprotoIdentityResolveHandle, ComAtprotoModerationCreateReport, ComAtprotoRepoCreateRecord, ComAtprotoRepoDeleteRecord, ComAtprotoRepoDescribeRepo, ComAtprotoRepoGetRecord, ComAtprotoRepoListRecords, ComAtprotoRepoPutRecord, ComAtprotoRepoUploadBlob, ComAtprotoServerDescribeServer, ComAtprotoSyncGetRecord, ComAtprotoSyncListReposComAtprotoRepoCreateRecord, ComAtprotoRepoDeleteRecord, ComAtprotoRepoGetRecord, ComAtprotoRepoListRecords, ComAtprotoIdentityRefreshIdentity } from "@atproto/api"' >> $$x; \
369 done \
370 && npx prettier --write $$(find ./js/streamplace/src/lexicons -type f -name '*.ts') \
371 && find . | grep bak$$ | xargs rm
372
373.PHONY: md-lexicons
374md-lexicons:
375 pnpm exec lexmd \
376 ./lexicons \
377 .build/temp \
378 subprojects/atproto/lexicons \
379 js/docs/src/content/docs/lex-reference/openapi.json \
380 && ls -R .build/temp \
381 && cp -rf .build/temp/place/stream/* js/docs/src/content/docs/lex-reference/ \
382 && rm -rf .build/temp \
383 && $(MAKE) fix
384
385.PHONY: lexgen
386lexgen:
387 $(MAKE) lexgen-types
388 $(MAKE) lexgen-server
389
390.PHONY: lexgen-types
391lexgen-types:
392 go run github.com/bluesky-social/indigo/cmd/lexgen \
393 -outdir ./pkg/spxrpc \
394 --build-file util/lexgen-types.json \
395 --external-lexicons subprojects/atproto/lexicons \
396 lexicons/place/stream \
397 ./subprojects/atproto/lexicons
398
399.PHONY: lexgen-server
400lexgen-server:
401 mkdir -p ./pkg/spxrpc \
402 && go run github.com/bluesky-social/indigo/cmd/lexgen \
403 --gen-server \
404 --types-import place.stream:stream.place/streamplace/pkg/streamplace \
405 --types-import app.bsky:github.com/bluesky-social/indigo/api/bsky \
406 --types-import com.atproto:github.com/bluesky-social/indigo/api/atproto \
407 --types-import chat.bsky:github.com/bluesky-social/indigo/api/chat \
408 --types-import tools.ozone:github.com/bluesky-social/indigo/api/ozone \
409 -outdir ./pkg/spxrpc \
410 --build-file util/lexgen-types.json \
411 --external-lexicons subprojects/atproto/lexicons \
412 --package spxrpc \
413 lexicons/place/stream \
414 lexicons/app/bsky \
415 lexicons/com/atproto
416
417.PHONY: ci-lexicons
418ci-lexicons:
419 $(MAKE) lexicons \
420 && if ! git diff --exit-code >/dev/null; then echo "lexicons are out of date, run 'make lexicons' to fix"; exit 1; fi
421
422# _______ ______ _____ _______ _____ _ _ _____
423# |__ __| ____|/ ____|__ __|_ _| \ | |/ ____|
424# | | | |__ | (___ | | | | | \| | | __
425# | | | __| \___ \ | | | | | . ` | | |_ |
426# | | | |____ ____) | | | _| |_| |\ | |__| |
427# |_| |______|_____/ |_| |_____|_| \_|\_____|
428
429# test to make sure we haven't added any more dynamic dependencies
430LINUX_LINK_COUNT=5
431.PHONY: link-test-linux
432link-test-linux:
433 count=$(shell ldd ./build-linux-amd64/streamplace | wc -l) \
434 && echo $$count \
435 && if [ "$$count" != "$(LINUX_LINK_COUNT)" ]; then echo "ldd reports new libaries linked! want $(LINUX_LINK_COUNT) got $$count" \
436 && ldd ./build-linux-amd64/streamplace \
437 && exit 1; \
438 fi
439
440MACOS_LINK_COUNT=10
441.PHONY: link-test-macos
442link-test-macos:
443 count=$(shell otool -L ./build-darwin-arm64/streamplace | wc -l | xargs) \
444 && echo $$count \
445 && if [ "$$count" != "$(MACOS_LINK_COUNT)" ]; then echo "otool -L reports new libaries linked! want $(MACOS_LINK_COUNT) got $$count" \
446 && otool -L ./build-darwin-arm64/streamplace \
447 && exit 1; \
448 fi
449
450WINDOWS_LINK_COUNT=19
451.PHONY: link-test-windows
452link-test-windows:
453 count=$(shell x86_64-w64-mingw32-objdump -p ./build-windows-amd64/streamplace.exe | grep "DLL Name" | tr '[:upper:]' '[:lower:]' | sort | uniq | wc -l | xargs) \
454 && echo $$count \
455 && if [ "$$count" != "$(WINDOWS_LINK_COUNT)" ]; then echo "x86_64-w64-mingw32-objdump -p reports new libaries linked! want $(WINDOWS_LINK_COUNT) got $$count" \
456 && x86_64-w64-mingw32-objdump -p ./build-windows-amd64/streamplace.exe | grep "DLL Name" \
457 && exit 1; \
458 fi
459
460.PHONY: ci
461ci: version install app node-all-platforms ci-upload-node
462
463
464.PHONY: ci-desktop-darwin
465ci-desktop-darwin: version install
466 ./util/mac-codesign.sh \
467 && for arch in amd64 arm64; do \
468 curl -v --fail-with-body -O "$$CI_API_V4_URL/projects/$$CI_PROJECT_ID/packages/generic/$(BRANCH)/$(VERSION)/streamplace-$(VERSION)-darwin-$$arch.tar.gz" || exit 1 \
469 && tar -xzvf streamplace-$(VERSION)-darwin-$$arch.tar.gz \
470 && ./streamplace --version \
471 && ./streamplace self-test \
472 && mkdir -p build-darwin-$$arch \
473 && mv ./streamplace ./build-darwin-$$arch/streamplace; \
474 done \
475 && $(MAKE) desktop-darwin \
476 && for arch in amd64 arm64; do \
477 export file=streamplace-desktop-$(VERSION)-darwin-$$arch.zip \
478 && $(MAKE) ci-upload-file upload_file=$$file \
479 && export file=streamplace-desktop-$(VERSION)-darwin-$$arch.dmg \
480 && $(MAKE) ci-upload-file upload_file=$$file; \
481 done
482
483.PHONY: ci-test
484ci-test: app
485 meson setup $(BUILDDIR) $(OPTS)
486 meson test -C $(BUILDDIR) go-tests
487
488.PHONY: ci-npm-release
489ci-npm-release: install
490 echo //registry.npmjs.org/:_authToken=$$NPM_TOKEN > ~/.npmrc \
491 && npx lerna publish from-package --yes
492
493.build/bundletool.jar:
494 mkdir -p .build \
495 && curl -L -o ./.build/bundletool.jar https://github.com/google/bundletool/releases/download/1.17.0/bundletool-all-1.17.0.jar
496
497.PHONY: selftest-macos
498selftest-macos:
499 js/desktop/out/Streamplace-darwin-arm64/Streamplace.app/Contents/MacOS/Streamplace -- --self-test
500
501# _____ _____ ____ _____ _____
502# / ____| __ \ / __ \ / ____/ ____|
503# | | | |__) | | | | (___| (___
504# | | | _ /| | | |\___ \\___ \
505# | |____| | \ \| |__| |____) |___) |
506# \_____|_| \_\\____/|_____/_____/
507# _____ ____ __ __ _____ _____ _ _____ _ _ _____
508# / ____/ __ \| \/ | __ \_ _| | |_ _| \ | |/ ____|
509# | | | | | | \ / | |__) || | | | | | | \| | | __
510# | | | | | | |\/| | ___/ | | | | | | | . ` | | |_ |
511# | |___| |__| | | | | | _| |_| |____ _| |_| |\ | |__| |
512# \_____\____/|_| |_|_| |_____|______|_____|_| \_|\_____|
513
514# Cross-compiling is exclusively right now from linux-amd64 to:
515
516# linux-amd64 (native)
517# linux-arm64
518# windows-amd64
519# darwin-amd64
520# darwin-arm64
521
522.PHONY: node-all-platforms
523node-all-platforms: app
524 meson setup build-linux-amd64 $(OPTS) --buildtype debugoptimized
525 meson compile -C build-linux-amd64 archive
526 $(MAKE) link-test-linux
527 $(MAKE) linux-arm64
528 $(MAKE) windows-amd64
529 $(MAKE) windows-amd64-startup-test
530 $(MAKE) desktop-linux
531 $(MAKE) desktop-windows-amd64
532
533.PHONY: desktop-linux
534desktop-linux:
535 $(MAKE) desktop-linux-amd64
536 $(MAKE) desktop-linux-arm64
537
538.PHONY: desktop-linux-amd64
539desktop-linux-amd64:
540 cd js/desktop \
541 && pnpm run make --platform linux --arch x64 \
542 && cd - \
543 && mv "js/desktop/out/make/AppImage/x64/Streamplace-$(VERSION_ELECTRON)-x64.AppImage" ./bin/streamplace-desktop-$(VERSION)-linux-amd64.AppImage
544
545.PHONY: desktop-linux-arm64
546desktop-linux-arm64:
547 cd js/desktop \
548 && pnpm run make --platform linux --arch arm64 \
549 && cd - \
550 && mv "js/desktop/out/make/AppImage/arm64/Streamplace-$(VERSION_ELECTRON)-arm64.AppImage" ./bin/streamplace-desktop-$(VERSION)-linux-arm64.AppImage
551
552.PHONY: desktop-windows-amd64
553desktop-windows-amd64:
554 cd js/desktop \
555 && pnpm run make --platform win32 --arch x64 \
556 && cd - \
557 && export SUM=$$(cat ./js/desktop/out/make/squirrel.windows/x64/streamplace_desktop-$(VERSION_ELECTRON)-full.nupkg | openssl sha1 | awk '{ print $$2 }') \
558 && echo $$SUM > ./bin/streamplace-desktop-$(VERSION)-windows-amd64.nupkg.sha1 \
559 && mv "js/desktop/out/make/squirrel.windows/x64/streamplace_desktop-$(VERSION_ELECTRON)-full.nupkg" ./bin/streamplace-desktop-$(VERSION)-windows-amd64.$$SUM.nupkg \
560 && mv "js/desktop/out/make/squirrel.windows/x64/Streamplace-$(VERSION_ELECTRON) Setup.exe" ./bin/streamplace-desktop-$(VERSION)-windows-amd64.exe
561
562.PHONY: streamplace
563streamplace: app-cached meson-setup-static
564 meson compile -C $(BUILDDIR) streamplace | grep -v drectve
565
566.PHONY: archive
567archive: app-cached meson-setup-static
568 meson compile -C $(BUILDDIR) archive | grep -v drectve
569
570.PHONY: linux-amd64
571linux-amd64:
572 $(MAKE) -j $(shell nproc) archive
573 $(MAKE) link-test-linux
574
575.PHONY: linux-arm64
576linux-arm64:
577 rustup target add aarch64-unknown-linux-gnu \
578 && CC=aarch64-linux-gnu-gcc \
579 LD=aarch64-linux-gnu-ld \
580 CROSS_COMPILE=1 \
581 MESON_SETUP_OPTS="--cross-file util/linux-arm64-gnu.ini" \
582 BUILDDIR=build-linux-arm64 \
583 CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
584 $(MAKE) -j $(shell nproc) archive
585
586.PHONY: windows-amd64
587windows-amd64:
588 rustup target add x86_64-pc-windows-gnu \
589 && CC=x86_64-w64-mingw32-gcc \
590 LD=x86_64-w64-mingw32-ld \
591 CROSS_COMPILE=1 \
592 MESON_SETUP_OPTS="--cross-file util/windows-amd64-gnu.ini" \
593 BUILDDIR=build-windows-amd64 \
594 $(MAKE) -j $(shell nproc) archive
595
596.PHONY: darwin-amd64
597darwin-amd64:
598 export CC=x86_64-apple-darwin24.4-clang \
599 && export CC_X86_64_APPLE_DARWIN=x86_64-apple-darwin24.4-clang \
600 && export CXX_X86_64_APPLE_DARWIN=x86_64-apple-darwin24.4-clang++ \
601 && export AR_X86_64_APPLE_DARWIN=x86_64-apple-darwin24.4-ar \
602 && export CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=x86_64-apple-darwin24.4-clang \
603 && export LD=x86_64-apple-darwin24.4-ld \
604 && export CROSS_COMPILE=1 \
605 && export MESON_SETUP_OPTS="--cross-file util/osxcross-darwin-amd64.ini" \
606 && export BUILDDIR=build-darwin-amd64 \
607 && $(MAKE) -j $(shell nproc) streamplace \
608 && ./util/osxcross-codesign.sh ./build-darwin-amd64/streamplace \
609 && mkdir -p bin \
610 && cd build-darwin-amd64 \
611 && tar -czvf ../bin/streamplace-$(VERSION)-darwin-amd64.tar.gz ./streamplace \
612 && cd -
613
614.PHONY: darwin-arm64gofmt -w .
615darwin-arm64:
616 export CC=aarch64-apple-darwin24.4-clang \
617 && export CC_AARCH64_APPLE_DARWIN=aarch64-apple-darwin24.4-clang \
618 && export CXX_AARCH64_APPLE_DARWIN=aarch64-apple-darwin24.4-clang++ \
619 && export AR_AARCH64_APPLE_DARWIN=aarch64-apple-darwin24.4-ar \
620 && export CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER=aarch64-apple-darwin24.4-clang \
621 && export LD=aarch64-apple-darwin24.4-ld \
622 && export CROSS_COMPILE=1 \
623 && export MESON_SETUP_OPTS="--cross-file util/osxcross-darwin-arm64.ini" \
624 && export BUILDDIR=build-darwin-arm64 \
625 && $(MAKE) -j $(shell nproc) streamplace \
626 && ./util/osxcross-codesign.sh ./build-darwin-arm64/streamplace \
627 && mkdir -p bin \
628 && cd build-darwin-arm64 \
629 && tar -czvf ../bin/streamplace-$(VERSION)-darwin-arm64.tar.gz ./streamplace \
630 && cd -
631
632# unbuffer here is a workaround for wine trying to pop up a terminal window and failing
633.PHONY: windows-amd64-startup-test
634windows-amd64-startup-test:
635 bash -c 'set -euo pipefail && unbuffer wine64 ./build-windows-amd64/streamplace.exe self-test | cat'
636
637.PHONY: desktop-darwin-amd64
638desktop-darwin-amd64:
639 echo "TODO"
640
641.PHONY: desktop-darwin-arm64
642desktop-darwin-arm64:
643 echo "TODO"
644
645.PHONY: desktop-darwin
646desktop-darwin:
647 export DEBUG="electron-osx-sign*" \
648 && cd js/desktop \
649 && pnpm run make --platform darwin --arch arm64 \
650 && pnpm run make --platform darwin --arch x64 \
651 && cd - \
652 && mv js/desktop/out/make/Streamplace-$(VERSION_ELECTRON)-x64.dmg ./bin/streamplace-desktop-$(VERSION)-darwin-amd64.dmg \
653 && mv js/desktop/out/make/Streamplace-$(VERSION_ELECTRON)-arm64.dmg ./bin/streamplace-desktop-$(VERSION)-darwin-arm64.dmg \
654 && mv js/desktop/out/make/zip/darwin/x64/Streamplace-darwin-x64-$(VERSION_ELECTRON).zip ./bin/streamplace-desktop-$(VERSION)-darwin-amd64.zip \
655 && mv js/desktop/out/make/zip/darwin/arm64/Streamplace-darwin-arm64-$(VERSION_ELECTRON).zip ./bin/streamplace-desktop-$(VERSION)-darwin-arm64.zip
656
657# link your local version of mist for dev
658.PHONY: link-mist
659link-mist:
660 rm -rf subprojects/mistserver
661 ln -s $$(realpath ../mistserver) ./subprojects/mistserver
662
663# link your local version of gstreamer
664.PHONY: link-gstreamer
665link-gstreamer:
666 rm -rf subprojects/gstreamer-full
667 ln -s $$(realpath ../gstreamer) ./subprojects/gstreamer-full
668
669# link your local version of ffmpeg for dev
670.PHONY: link-ffmpeg
671link-ffmpeg:
672 rm -rf subprojects/FFmpeg
673 ln -s $$(realpath ../ffmpeg) ./subprojects/FFmpeg
674
675# _____ ____ _____ _ ________ _____
676# | __ \ / __ \ / ____| |/ / ____| __ \
677# | | | | | | | | | ' /| |__ | |__) |
678# | | | | | | | | | < | __| | _ /
679# | |__| | |__| | |____| . \| |____| | \ \
680# |_____/ \____/ \_____|_|\_\______|_| \_\
681
682# Actually, Podman. I'm not sure if these commands will actually run on Docker, untested.
683
684.PHONY: docker
685docker:
686 docker build -f docker/local.Dockerfile -t dist.stream.place/streamplace/streamplace:local .
687
688.PHONY: docker-build
689docker-build: docker-build-builder docker-build-in-container
690
691.PHONY: docker-test
692docker-test: docker-build-builder docker-test-in-container
693
694DOCKER_BUILD_OPTS?=
695BUILDER_TARGET?=builder
696.PHONY: docker-build-builder
697docker-build-builder:
698 podman build --target=$(BUILDER_TARGET) --os=linux --arch=amd64 -f docker/build.Dockerfile -t dist.stream.place/streamplace/streamplace:$(BUILDER_TARGET) $(DOCKER_BUILD_OPTS) .
699
700.PHONY: precommit
701precommit: dockerfile-hash-precommit
702
703.PHONY: dockefile-hash-precommit
704dockerfile-hash-precommit:
705 @bash -c 'printf "variables:\n DOCKERFILE_HASH: `git hash-object docker/build.Dockerfile`" > .ci/dockerfile-hash.yaml' \
706 && git add .ci/dockerfile-hash.yaml
707
708# tricks the github action for golangci-lint to run inside a container
709.PHONY: golangci-lint-container
710golangci-lint-container: docker-build-builder
711 podman run \
712 -v $$(pwd):$$(pwd) \
713 -w $$(pwd) \
714 -e PKG_CONFIG_PATH=$$(pwd)/build-linux-amd64/lib/pkgconfig \
715 -d \
716 --name golangci-lint \
717 dist.stream.place/streamplace/streamplace:$(BUILDER_TARGET) \
718 tail -f /dev/null
719 podman exec golangci-lint mkdir -p js/app/dist
720 podman exec golangci-lint touch js/app/dist/index.html
721 podman exec golangci-lint make dev
722
723# runs a command in the build container, building if necessary
724IN_CONTAINER_CMD?=echo 'usage: make in-container IN_CONTAINER_CMD=\"<command>\"'
725DOCKER_BIN?=podman
726DOCKER_REF?=dist.stream.place/streamplace/streamplace:$(BUILDER_TARGET)
727DOCKER_OPTS?=
728.PHONY: in-container
729in-container: docker-build-builder
730 $(DOCKER_BIN) run $(DOCKER_OPTS) -v $$(pwd):$$(pwd) -w $$(pwd) --rm $(DOCKER_REF) bash -c "$(IN_CONTAINER_CMD)"
731
732.PHONY: docker-shell
733docker-shell:
734 $(MAKE) in-container IN_CONTAINER_CMD="bash" DOCKER_OPTS="-it -v $$(pwd):$$(pwd) -w $$(pwd)"
735
736STREAMPLACE_URL?=https://git.stream.place/streamplace/streamplace/-/package_files/10122/download
737.PHONY: docker-release
738docker-release:
739 cd docker \
740 && docker build -f release.Dockerfile \
741 --build-arg TARGETARCH=$(BUILDARCH) \
742 --build-arg STREAMPLACE_URL=$(STREAMPLACE_URL) \
743 -t dist.stream.place/streamplace/streamplace \
744 .
745
746.PHONY: docker-mistserver
747docker-mistserver:
748 cd docker \
749 && docker build -f mistserver.Dockerfile \
750 --build-arg TARGETARCH=$(BUILDARCH) \
751 --build-arg STREAMPLACE_URL=$(STREAMPLACE_URL) \
752 -t dist.stream.place/streamplace/streamplace:mistserver \
753
754# _____ _____ _____ _______ _____ ____
755# | __ \_ _|/ ____|__ __| __ \ / __ \
756# | | | || | | (___ | | | |__) | | | |
757# | | | || | \___ \ | | | _ /| | | |
758# | |__| || |_ ____) | | | | | \ \| |__| |
759# |_____/_____|_____/ |_| |_| \_\\____/
760
761# distro: cut new versions, build apt and brew packages, upload to S3/gitlab
762
763.PHONY: release
764release: install
765 $(MAKE) lexicons
766 pnpm run release
767
768.PHONY: ci-release
769ci-release:
770 go install gitlab.com/gitlab-org/release-cli/cmd/release-cli
771 go run ./pkg/config/git/git.go -release -o release.yml
772 release-cli create-from-file --file release.yml
773
774.PHONY: homebrew
775homebrew:
776 $(MAKE) ci-download-file download_file=streamplace-$(VERSION)-linux-amd64.tar.gz
777 $(MAKE) ci-download-file download_file=streamplace-$(VERSION)-linux-arm64.tar.gz
778 $(MAKE) ci-download-file download_file=streamplace-$(VERSION)-darwin-amd64.tar.gz
779 $(MAKE) ci-download-file download_file=streamplace-$(VERSION)-darwin-arm64.tar.gz
780 git clone git@github.com:streamplace/homebrew-streamplace.git /tmp/homebrew-streamplace
781 go run ./pkg/config/git/git.go -homebrew -o /tmp/homebrew-streamplace/Formula/streamplace.rb
782
783.PHONY: ci-homebrew
784ci-homebrew:
785 git config --global user.name "Streamplace Homebrew Robot"
786 git config --global user.email support@stream.place
787 mkdir -p ~/.ssh
788 echo "Host * \n\
789 StrictHostKeyChecking no \n\
790 UserKnownHostsFile=/dev/null" > ~/.ssh/config
791 echo "$$CI_HOMEBREW_KEY_BASE64" | base64 -d > ~/.ssh/id_ed25519
792 chmod 600 ~/.ssh/id_ed25519
793
794 chmod 600 ~/.ssh/config
795 $(MAKE) homebrew
796 cd /tmp/homebrew-streamplace \
797 && git add . \
798 && git commit -m "Update streamplace $(VERSION)" \
799 && git push
800
801FPM_BASE_OPTS= \
802 -s dir \
803 -t deb \
804 -v $(VERSION_NO_V) \
805 --force \
806 --license=GPL-3.0-or-later \
807 --maintainer="Streamplace <support@stream.place>" \
808 --vendor="Streamplace" \
809 --url="https://stream.place"
810SP_ARCH_NAME?=amd64
811.PHONY: deb-pkg
812deb-pkg:
813 fpm $(FPM_BASE_OPTS) \
814 -n streamplace \
815 -a $(SP_ARCH_NAME) \
816 -p bin/streamplace-$(VERSION)-linux-$(SP_ARCH_NAME).deb \
817 --deb-systemd=util/systemd/streamplace.service \
818 --deb-systemd-restart-after-upgrade \
819 --after-install=util/systemd/after-install.sh \
820 --description="Live video for the AT Protocol. Solving video for everybody forever." \
821 build-linux-$(SP_ARCH_NAME)/streamplace=/usr/bin/streamplace \
822 && fpm $(FPM_BASE_OPTS) \
823 -n streamplace-default-http \
824 -a $(SP_ARCH_NAME) \
825 -d streamplace \
826 --deb-systemd-restart-after-upgrade \
827 -p bin/streamplace-default-http-$(VERSION)-linux-$(SP_ARCH_NAME).deb \
828 --description="Installing this package will install Streamplace as the default HTTP server on ports 80 and 443." \
829 util/systemd/streamplace-http.socket=/lib/systemd/system/streamplace-http.socket \
830 util/systemd/streamplace-https.socket=/lib/systemd/system/streamplace-https.socket
831
832.PHONY: pkg-linux-amd64
833pkg-linux-amd64:
834 $(MAKE) deb-pkg SP_ARCH_NAME=amd64
835
836.PHONY: pkg-linux-arm64
837pkg-linux-arm64:
838 $(MAKE) deb-pkg SP_ARCH_NAME=arm64
839
840.PHONY: pkg-darwin-amd64
841pkg-darwin-amd64:
842 echo todo
843
844.PHONY: pkg-darwin-arm64
845pkg-darwin-arm64:
846 echo todo
847
848.PHONY: pkg-windows-amd64
849pkg-windows-amd64:
850 echo todo
851
852.PHONY: deb-release
853deb-release:
854 aptly repo create -distribution=all -component=main streamplace-releases
855 aptly mirror create old-version $$S3_PUBLIC_URL/debian all
856 aptly mirror update old-version
857 aptly repo import old-version streamplace-releases streamplace streamplace-default-http
858 aptly repo add streamplace-releases \
859 bin/streamplace-default-http-$(VERSION)-linux-arm64.deb \
860 bin/streamplace-$(VERSION)-linux-arm64.deb \
861 bin/streamplace-default-http-$(VERSION)-linux-amd64.deb \
862 bin/streamplace-$(VERSION)-linux-amd64.deb
863 aptly snapshot create streamplace-$(VERSION) from repo streamplace-releases
864 aptly publish snapshot -distribution=all streamplace-$(VERSION) s3:streamplace-releases:
865
866.PHONY: ci-deb-release
867ci-deb-release:
868 $(MAKE) ci-download-file download_file=streamplace-default-http-$(VERSION)-linux-amd64.deb
869 $(MAKE) ci-download-file download_file=streamplace-$(VERSION)-linux-amd64.deb
870 $(MAKE) ci-download-file download_file=streamplace-default-http-$(VERSION)-linux-arm64.deb
871 $(MAKE) ci-download-file download_file=streamplace-$(VERSION)-linux-arm64.deb
872 echo $$CI_SIGNING_KEY_BASE64 | base64 -d | gpg --import
873 gpg --armor --export | gpg --no-default-keyring --keyring trustedkeys.gpg --import
874 echo '{"S3PublishEndpoints":{"streamplace-releases":{"region":"'$$S3_REGION'","bucket":"'$$S3_BUCKET_NAME'","endpoint":"'$$S3_ENDPOINT'","acl":"public-read","prefix":"debian"}}}' > ~/.aptly.conf
875 $(MAKE) deb-release
876
877# _____ _____
878# / ____|_ _|
879# | | | |
880# | | | |
881# | |____ _| |_
882# \_____|_____|
883
884# mostly "do a thing and then gitlab upload the artifact"
885
886.PHONY: ci-upload
887ci-upload: ci-upload-node ci-upload-android
888
889.PHONY: ci-upload-node-linux-amd64
890ci-upload-node-linux-amd64:
891 $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-linux-amd64.tar.gz \
892 && $(MAKE) ci-upload-file upload_file=streamplace-desktop-$(VERSION)-linux-amd64.AppImage \
893 && $(MAKE) ci-upload-file upload_file=streamplace-default-http-$(VERSION)-linux-amd64.deb \
894 && $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-linux-amd64.deb
895
896.PHONY: ci-upload-node-linux-arm64
897ci-upload-node-linux-arm64:
898 $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-linux-arm64.tar.gz \
899 && $(MAKE) ci-upload-file upload_file=streamplace-desktop-$(VERSION)-linux-arm64.AppImage \
900 && $(MAKE) ci-upload-file upload_file=streamplace-default-http-$(VERSION)-linux-arm64.deb \
901 && $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-linux-arm64.deb
902
903.PHONY: ci-upload-node-darwin-arm64
904ci-upload-node-darwin-arm64:
905 export file=streamplace-$(VERSION)-darwin-arm64.tar.gz \
906 && $(MAKE) ci-upload-file upload_file=$$file;
907
908.PHONY: ci-upload-node-darwin-amd64
909ci-upload-node-darwin-amd64:
910 export file=streamplace-$(VERSION)-darwin-amd64.tar.gz \
911 && $(MAKE) ci-upload-file upload_file=$$file;
912
913.PHONY: ci-upload-node-windows-amd64
914ci-upload-node-windows-amd64:
915 export file=streamplace-$(VERSION)-windows-amd64.zip \
916 && $(MAKE) ci-upload-file upload_file=$$file; \
917 export file=streamplace-desktop-$(VERSION)-windows-amd64.exe \
918 && $(MAKE) ci-upload-file upload_file=$$file; \
919 export SUM=$$(cat bin/streamplace-desktop-$(VERSION)-windows-amd64.nupkg.sha1) \
920 && export file=streamplace-desktop-$(VERSION)-windows-amd64.$$SUM.nupkg \
921 && $(MAKE) ci-upload-file upload_file=$$file;
922
923.PHONY: ci-upload-node-macos
924ci-upload-node-macos: node-all-platforms-macos
925 for GOOS in darwin; do \
926 for GOARCH in amd64 arm64; do \
927 export file=streamplace-$(VERSION)-$$GOOS-$$GOARCH.tar.gz \
928 && $(MAKE) ci-upload-file upload_file=$$file; \
929 export file=streamplace-desktop-$(VERSION)-$$GOOS-$$GOARCH.dmg \
930 && $(MAKE) ci-upload-file upload_file=$$file; \
931 export file=streamplace-desktop-$(VERSION)-$$GOOS-$$GOARCH.zip \
932 && $(MAKE) ci-upload-file upload_file=$$file; \
933 done \
934 done;
935
936.PHONY: ci-upload-android
937ci-upload-android: android
938 $(MAKE) ci-upload-android-debug \
939 && $(MAKE) ci-upload-android-release
940
941.PHONY: ci-upload-android-debug
942ci-upload-android-debug:
943 $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-android-debug.apk \
944 && $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-android-debug.aab
945
946.PHONY: ci-upload-android-release
947ci-upload-android-release:
948 $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-android-release.apk \
949 && $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-android-release.aab
950
951.PHONY: ci-upload-ios
952ci-upload-ios: ios
953 $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-ios-release.xcarchive.tar.gz
954
955upload_file?=""
956.PHONY: ci-upload-file
957ci-upload-file:
958 curl \
959 --fail-with-body \
960 --header "JOB-TOKEN: $$CI_JOB_TOKEN" \
961 --upload-file bin/$(upload_file) \
962 "$$CI_API_V4_URL/projects/$$CI_PROJECT_ID/packages/generic/$(BRANCH)/$(VERSION)/$(upload_file)";
963
964download_file?=""
965.PHONY: ci-download-file
966ci-download-file:
967 curl \
968 --fail-with-body \
969 --header "JOB-TOKEN: $$CI_JOB_TOKEN" \
970 -o bin/$(download_file) \
971 "$$CI_API_V4_URL/projects/$$CI_PROJECT_ID/packages/generic/$(BRANCH)/$(VERSION)/$(download_file)";
972
973.PHONY: c2pa-types
974c2pa-types:
975 $(MAKE) dev-rust
976 ./target/debug/export_c2pa_schema
977 npx quicktype --lang go --src-lang schema --package c2patypes --out pkg/c2patypes/c2patypes.go ./target/schema/C2PA.schema.json
978 gofmt -w pkg/c2patypes/c2patypes.go