fork
Configure Feed
Select the types of activity you want to include in your feed.
Live video on the AT Protocol
fork
Configure Feed
Select the types of activity you want to include in your feed.
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 -tags mainnet -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 meson setup --default-library=shared $(BUILDDIR) $(SHARED_OPTS)
285 meson configure --default-library=shared $(BUILDDIR) $(SHARED_OPTS)
286
287.PHONY: dev-rust
288dev-rust: .build/bin/uniffi-bindgen-go-forked
289 cargo build
290 EXT=so; \
291 if [ "$(BUILDOS)" = "darwin" ]; then EXT=dylib; fi; \
292 .build/bin/uniffi-bindgen-go-forked --out-dir pkg/iroh/generated --library ./target/debug/libiroh_streamplace.$$EXT \
293 && mkdir -p $(BUILDDIR)/rust/iroh-streamplace/ \
294 && mkdir -p $(BUILDDIR)/lib/ \
295 && cp ./target/debug/libiroh_streamplace.$$EXT $(BUILDDIR)/rust/iroh-streamplace/libiroh_streamplace.$$EXT.tmp \
296 && mv $(BUILDDIR)/rust/iroh-streamplace/libiroh_streamplace.$$EXT.tmp $(BUILDDIR)/rust/iroh-streamplace/libiroh_streamplace.$$EXT \
297 && cp ./target/debug/libiroh_streamplace.$$EXT $(BUILDDIR)/lib/libiroh_streamplace.$$EXT.tmp \
298 && mv $(BUILDDIR)/lib/libiroh_streamplace.$$EXT.tmp $(BUILDDIR)/lib/libiroh_streamplace.$$EXT
299
300.PHONY: dev-test
301dev-test:
302 go install github.com/jstemmer/go-junit-report/v2@latest \
303 && PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) \
304 LD_LIBRARY_PATH=$(shell realpath $(BUILDDIR))/lib \
305 bash -euo pipefail -c "go test -p 1 -timeout 300s ./pkg/... -v | tee /dev/stderr | go-junit-report -out test.xml"
306
307.PHONY: iroh-test
308iroh-test:
309 $(MAKE) dev-rust
310 PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) \
311 LD_LIBRARY_PATH=$(shell realpath $(BUILDDIR))/lib \
312 go build -o $(BUILDDIR)/iroh-test ./pkg/iroh/iroh_test/...
313
314# _ _____ _ _ _______ _____ _ _ _____
315# | | |_ _| \ | |__ __|_ _| \ | |/ ____|
316# | | | | | \| | | | | | | \| | | __
317# | | | | | . ` | | | | | | . ` | | |_ |
318# | |____ _| |_| |\ | | | _| |_| |\ | |__| |
319# |______|_____|_| \_| |_| |_____|_| \_|\_____|
320
321.PHONY: check
322check: install
323 $(MAKE) golangci-lint
324 pnpm run check
325 if [ "`gofmt -l . | wc -l`" -gt 0 ]; then echo 'gofmt failed, run make fix'; exit 1; fi
326 RUSTFLAGS="-D warnings" cargo check
327
328.PHONY: fix
329fix:
330 pnpm run fix
331 gofmt -w .
332 cargo fix --allow-dirty
333
334.PHONY: golangci-lint
335golangci-lint:
336 @PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) \
337 go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint run -c ./.golangci.yaml
338
339# _ ________ _______ _____ ____ _ _ _____
340# | | | ____\ \ / /_ _/ ____/ __ \| \ | |/ ____|
341# | | | |__ \ V / | || | | | | | \| | (___
342# | | | __| > < | || | | | | | . ` |\___ \
343# | |____| |____ / . \ _| || |___| |__| | |\ |____) |
344# |______|______/_/ \_\_____\_____\____/|_| \_|_____/
345
346# Mostly codegen for lexicons.
347
348.PHONY: lexicons
349lexicons:
350 $(MAKE) go-lexicons \
351 && $(MAKE) js-lexicons \
352 && $(MAKE) md-lexicons \
353 && make fix
354
355.PHONY: go-lexicons
356go-lexicons:
357 rm -rf ./pkg/streamplace \
358 && mkdir -p ./pkg/streamplace \
359 && rm -rf ./pkg/streamplace/cbor_gen.go \
360 && $(MAKE) lexgen \
361 && sed -i.bak 's/\tutil/\/\/\tutil/' $$(find ./pkg/streamplace -type f) \
362 && go run golang.org/x/tools/cmd/goimports@latest -w $$(find ./pkg/streamplace -type f) \
363 && go run ./pkg/gen/gen.go \
364 && $(MAKE) lexgen \
365 && find . | grep bak$$ | xargs rm \
366 && rm -rf api
367
368.PHONY: js-lexicons
369js-lexicons:
370 node_modules/.bin/lex gen-api ./js/streamplace/src/lexicons $$(find ./lexicons -type f -name '*.json') --yes \
371 && rm -rf ./js/streamplace/src/lexicons/types/com ./js/streamplace/src/lexicons/types/app \
372 && sed -i.bak "s/^..port.*app\/bsky.*//g" $$(find ./js/streamplace/src/lexicons -type f) \
373 && sed -i.bak "s/^..port.*com\/atproto.*//g" $$(find ./js/streamplace/src/lexicons -type f) \
374 && sed -i.bak "s/\(..port .*\)\.js\(.*\)/\1\2/g" $$(find ./js/streamplace/src/lexicons -type f) \
375 && sed -i.bak 's/AppBskyGraphBlock\.Main/AppBskyGraphBlock\.Record/' $$(find ./js/streamplace/src/lexicons/types/place/stream -type f) \
376 && sed -i.bak 's/PlaceStreamChatProfile\.Main/PlaceStreamChatProfile\.Record/' $$(find ./js/streamplace/src/lexicons/types/place/stream -type f) \
377 && for x in $$(find ./js/streamplace/src/lexicons -type f -name '*.ts'); do \
378 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; \
379 done \
380 && npx prettier --write $$(find ./js/streamplace/src/lexicons -type f -name '*.ts') \
381 && find . | grep bak$$ | xargs rm
382
383.PHONY: md-lexicons
384md-lexicons:
385 pnpm exec lexmd \
386 ./lexicons \
387 .build/temp \
388 subprojects/atproto/lexicons \
389 js/docs/src/content/docs/lex-reference/openapi.json \
390 && ls -R .build/temp \
391 && cp -rf .build/temp/place/stream/* js/docs/src/content/docs/lex-reference/ \
392 && rm -rf .build/temp \
393 && $(MAKE) fix
394
395.PHONY: lexgen
396lexgen:
397 $(MAKE) lexgen-types
398 $(MAKE) lexgen-server
399
400.PHONY: lexgen-types
401lexgen-types:
402 go run github.com/bluesky-social/indigo/cmd/lexgen \
403 -outdir ./pkg/spxrpc \
404 --build-file util/lexgen-types.json \
405 --external-lexicons subprojects/atproto/lexicons \
406 lexicons/place/stream \
407 ./subprojects/atproto/lexicons
408
409.PHONY: lexgen-server
410lexgen-server:
411 mkdir -p ./pkg/spxrpc \
412 && go run github.com/bluesky-social/indigo/cmd/lexgen \
413 --gen-server \
414 --types-import place.stream:stream.place/streamplace/pkg/streamplace \
415 --types-import app.bsky:github.com/bluesky-social/indigo/api/bsky \
416 --types-import com.atproto:github.com/bluesky-social/indigo/api/atproto \
417 --types-import chat.bsky:github.com/bluesky-social/indigo/api/chat \
418 --types-import tools.ozone:github.com/bluesky-social/indigo/api/ozone \
419 -outdir ./pkg/spxrpc \
420 --build-file util/lexgen-types.json \
421 --external-lexicons subprojects/atproto/lexicons \
422 --package spxrpc \
423 lexicons/place/stream \
424 lexicons/app/bsky \
425 lexicons/com/atproto
426
427.PHONY: ci-lexicons
428ci-lexicons:
429 $(MAKE) lexicons \
430 && if ! git diff --exit-code >/dev/null; then echo "lexicons are out of date, run 'make lexicons' to fix"; exit 1; fi
431
432# _______ ______ _____ _______ _____ _ _ _____
433# |__ __| ____|/ ____|__ __|_ _| \ | |/ ____|
434# | | | |__ | (___ | | | | | \| | | __
435# | | | __| \___ \ | | | | | . ` | | |_ |
436# | | | |____ ____) | | | _| |_| |\ | |__| |
437# |_| |______|_____/ |_| |_____|_| \_|\_____|
438
439# test to make sure we haven't added any more dynamic dependencies
440LINUX_LINK_COUNT=5
441.PHONY: link-test-linux
442link-test-linux:
443 count=$(shell ldd ./build-linux-amd64/streamplace | wc -l) \
444 && echo $$count \
445 && if [ "$$count" != "$(LINUX_LINK_COUNT)" ]; then echo "ldd reports new libaries linked! want $(LINUX_LINK_COUNT) got $$count" \
446 && ldd ./build-linux-amd64/streamplace \
447 && exit 1; \
448 fi
449
450MACOS_LINK_COUNT=10
451.PHONY: link-test-macos
452link-test-macos:
453 count=$(shell otool -L ./build-darwin-arm64/streamplace | wc -l | xargs) \
454 && echo $$count \
455 && if [ "$$count" != "$(MACOS_LINK_COUNT)" ]; then echo "otool -L reports new libaries linked! want $(MACOS_LINK_COUNT) got $$count" \
456 && otool -L ./build-darwin-arm64/streamplace \
457 && exit 1; \
458 fi
459
460WINDOWS_LINK_COUNT=19
461.PHONY: link-test-windows
462link-test-windows:
463 count=$(shell x86_64-w64-mingw32-objdump -p ./build-windows-amd64/streamplace.exe | grep "DLL Name" | tr '[:upper:]' '[:lower:]' | sort | uniq | wc -l | xargs) \
464 && echo $$count \
465 && if [ "$$count" != "$(WINDOWS_LINK_COUNT)" ]; then echo "x86_64-w64-mingw32-objdump -p reports new libaries linked! want $(WINDOWS_LINK_COUNT) got $$count" \
466 && x86_64-w64-mingw32-objdump -p ./build-windows-amd64/streamplace.exe | grep "DLL Name" \
467 && exit 1; \
468 fi
469
470.PHONY: ci
471ci: version install app node-all-platforms ci-upload-node
472
473
474.PHONY: ci-desktop-darwin
475ci-desktop-darwin: version install
476 ./util/mac-codesign.sh \
477 && for arch in amd64 arm64; do \
478 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 \
479 && tar -xzvf streamplace-$(VERSION)-darwin-$$arch.tar.gz \
480 && ./streamplace --version \
481 && ./streamplace self-test \
482 && mkdir -p build-darwin-$$arch \
483 && mv ./streamplace ./build-darwin-$$arch/streamplace; \
484 done \
485 && $(MAKE) desktop-darwin \
486 && for arch in amd64 arm64; do \
487 export file=streamplace-desktop-$(VERSION)-darwin-$$arch.zip \
488 && $(MAKE) ci-upload-file upload_file=$$file \
489 && export file=streamplace-desktop-$(VERSION)-darwin-$$arch.dmg \
490 && $(MAKE) ci-upload-file upload_file=$$file; \
491 done
492
493.PHONY: ci-test
494ci-test: app
495 meson setup $(BUILDDIR) $(OPTS)
496 meson test -C $(BUILDDIR) go-tests
497
498.PHONY: ci-npm-release
499ci-npm-release: install
500 echo //registry.npmjs.org/:_authToken=$$NPM_TOKEN > ~/.npmrc \
501 && npx lerna publish from-package --yes
502
503.build/bin/uniffi-bindgen-go-forked:
504 mkdir -p .build \
505 && cargo install uniffi-bindgen-go --git https://github.com/kegsay/uniffi-bindgen-go --rev f1f1064871faf05377c75e098d525d530d402d38 --root .build \
506 && mv .build/bin/uniffi-bindgen-go .build/bin/uniffi-bindgen-go-forked
507
508.build/bundletool.jar:
509 mkdir -p .build \
510 && curl -L -o ./.build/bundletool.jar https://github.com/google/bundletool/releases/download/1.17.0/bundletool-all-1.17.0.jar
511
512.PHONY: selftest-macos
513selftest-macos:
514 js/desktop/out/Streamplace-darwin-arm64/Streamplace.app/Contents/MacOS/Streamplace -- --self-test
515
516# _____ _____ ____ _____ _____
517# / ____| __ \ / __ \ / ____/ ____|
518# | | | |__) | | | | (___| (___
519# | | | _ /| | | |\___ \\___ \
520# | |____| | \ \| |__| |____) |___) |
521# \_____|_| \_\\____/|_____/_____/
522# _____ ____ __ __ _____ _____ _ _____ _ _ _____
523# / ____/ __ \| \/ | __ \_ _| | |_ _| \ | |/ ____|
524# | | | | | | \ / | |__) || | | | | | | \| | | __
525# | | | | | | |\/| | ___/ | | | | | | | . ` | | |_ |
526# | |___| |__| | | | | | _| |_| |____ _| |_| |\ | |__| |
527# \_____\____/|_| |_|_| |_____|______|_____|_| \_|\_____|
528
529# Cross-compiling is exclusively right now from linux-amd64 to:
530
531# linux-amd64 (native)
532# linux-arm64
533# windows-amd64
534# darwin-amd64
535# darwin-arm64
536
537.PHONY: node-all-platforms
538node-all-platforms: app
539 meson setup build-linux-amd64 $(OPTS) --buildtype debugoptimized
540 meson compile -C build-linux-amd64 archive
541 $(MAKE) link-test-linux
542 $(MAKE) linux-arm64
543 $(MAKE) windows-amd64
544 $(MAKE) windows-amd64-startup-test
545 $(MAKE) desktop-linux
546 $(MAKE) desktop-windows-amd64
547
548.PHONY: desktop-linux
549desktop-linux:
550 $(MAKE) desktop-linux-amd64
551 $(MAKE) desktop-linux-arm64
552
553.PHONY: desktop-linux-amd64
554desktop-linux-amd64:
555 cd js/desktop \
556 && pnpm run make --platform linux --arch x64 \
557 && cd - \
558 && mv "js/desktop/out/make/AppImage/x64/Streamplace-$(VERSION_ELECTRON)-x64.AppImage" ./bin/streamplace-desktop-$(VERSION)-linux-amd64.AppImage
559
560.PHONY: desktop-linux-arm64
561desktop-linux-arm64:
562 cd js/desktop \
563 && pnpm run make --platform linux --arch arm64 \
564 && cd - \
565 && mv "js/desktop/out/make/AppImage/arm64/Streamplace-$(VERSION_ELECTRON)-arm64.AppImage" ./bin/streamplace-desktop-$(VERSION)-linux-arm64.AppImage
566
567.PHONY: desktop-windows-amd64
568desktop-windows-amd64:
569 cd js/desktop \
570 && pnpm run make --platform win32 --arch x64 \
571 && cd - \
572 && export SUM=$$(cat ./js/desktop/out/make/squirrel.windows/x64/streamplace_desktop-$(VERSION_ELECTRON)-full.nupkg | openssl sha1 | awk '{ print $$2 }') \
573 && echo $$SUM > ./bin/streamplace-desktop-$(VERSION)-windows-amd64.nupkg.sha1 \
574 && mv "js/desktop/out/make/squirrel.windows/x64/streamplace_desktop-$(VERSION_ELECTRON)-full.nupkg" ./bin/streamplace-desktop-$(VERSION)-windows-amd64.$$SUM.nupkg \
575 && mv "js/desktop/out/make/squirrel.windows/x64/Streamplace-$(VERSION_ELECTRON) Setup.exe" ./bin/streamplace-desktop-$(VERSION)-windows-amd64.exe
576
577.PHONY: streamplace
578streamplace: app-cached meson-setup-static
579 meson compile -C $(BUILDDIR) streamplace | grep -v drectve
580
581.PHONY: archive
582archive: app-cached meson-setup-static
583 meson compile -C $(BUILDDIR) archive | grep -v drectve
584
585.PHONY: linux-amd64
586linux-amd64:
587 $(MAKE) -j $(shell nproc) archive
588 $(MAKE) link-test-linux
589
590.PHONY: linux-arm64
591linux-arm64:
592 rustup target add aarch64-unknown-linux-gnu \
593 && CC=aarch64-linux-gnu-gcc \
594 LD=aarch64-linux-gnu-ld \
595 CROSS_COMPILE=1 \
596 MESON_SETUP_OPTS="--cross-file util/linux-arm64-gnu.ini" \
597 BUILDDIR=build-linux-arm64 \
598 CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
599 $(MAKE) -j $(shell nproc) archive
600
601.PHONY: windows-amd64
602windows-amd64:
603 rustup target add x86_64-pc-windows-gnu \
604 && CC=x86_64-w64-mingw32-gcc \
605 LD=x86_64-w64-mingw32-ld \
606 CROSS_COMPILE=1 \
607 MESON_SETUP_OPTS="--cross-file util/windows-amd64-gnu.ini" \
608 BUILDDIR=build-windows-amd64 \
609 $(MAKE) -j $(shell nproc) archive
610
611.PHONY: darwin-amd64
612darwin-amd64:
613 export CC=x86_64-apple-darwin24.4-clang \
614 && export CC_X86_64_APPLE_DARWIN=x86_64-apple-darwin24.4-clang \
615 && export CXX_X86_64_APPLE_DARWIN=x86_64-apple-darwin24.4-clang++ \
616 && export AR_X86_64_APPLE_DARWIN=x86_64-apple-darwin24.4-ar \
617 && export CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=x86_64-apple-darwin24.4-clang \
618 && export LD=x86_64-apple-darwin24.4-ld \
619 && export CROSS_COMPILE=1 \
620 && export MESON_SETUP_OPTS="--cross-file util/osxcross-darwin-amd64.ini" \
621 && export BUILDDIR=build-darwin-amd64 \
622 && $(MAKE) -j $(shell nproc) streamplace \
623 && ./util/osxcross-codesign.sh ./build-darwin-amd64/streamplace \
624 && mkdir -p bin \
625 && cd build-darwin-amd64 \
626 && tar -czvf ../bin/streamplace-$(VERSION)-darwin-amd64.tar.gz ./streamplace \
627 && cd -
628
629.PHONY: darwin-arm64gofmt -w .
630darwin-arm64:
631 export CC=aarch64-apple-darwin24.4-clang \
632 && export CC_AARCH64_APPLE_DARWIN=aarch64-apple-darwin24.4-clang \
633 && export CXX_AARCH64_APPLE_DARWIN=aarch64-apple-darwin24.4-clang++ \
634 && export AR_AARCH64_APPLE_DARWIN=aarch64-apple-darwin24.4-ar \
635 && export CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER=aarch64-apple-darwin24.4-clang \
636 && export LD=aarch64-apple-darwin24.4-ld \
637 && export CROSS_COMPILE=1 \
638 && export MESON_SETUP_OPTS="--cross-file util/osxcross-darwin-arm64.ini" \
639 && export BUILDDIR=build-darwin-arm64 \
640 && $(MAKE) -j $(shell nproc) streamplace \
641 && ./util/osxcross-codesign.sh ./build-darwin-arm64/streamplace \
642 && mkdir -p bin \
643 && cd build-darwin-arm64 \
644 && tar -czvf ../bin/streamplace-$(VERSION)-darwin-arm64.tar.gz ./streamplace \
645 && cd -
646
647# unbuffer here is a workaround for wine trying to pop up a terminal window and failing
648.PHONY: windows-amd64-startup-test
649windows-amd64-startup-test:
650 bash -c 'set -euo pipefail && unbuffer wine64 ./build-windows-amd64/streamplace.exe self-test | cat'
651
652.PHONY: desktop-darwin-amd64
653desktop-darwin-amd64:
654 echo "TODO"
655
656.PHONY: desktop-darwin-arm64
657desktop-darwin-arm64:
658 echo "TODO"
659
660.PHONY: desktop-darwin
661desktop-darwin:
662 export DEBUG="electron-osx-sign*" \
663 && cd js/desktop \
664 && pnpm run make --platform darwin --arch arm64 \
665 && pnpm run make --platform darwin --arch x64 \
666 && cd - \
667 && mv js/desktop/out/make/Streamplace-$(VERSION_ELECTRON)-x64.dmg ./bin/streamplace-desktop-$(VERSION)-darwin-amd64.dmg \
668 && mv js/desktop/out/make/Streamplace-$(VERSION_ELECTRON)-arm64.dmg ./bin/streamplace-desktop-$(VERSION)-darwin-arm64.dmg \
669 && mv js/desktop/out/make/zip/darwin/x64/Streamplace-darwin-x64-$(VERSION_ELECTRON).zip ./bin/streamplace-desktop-$(VERSION)-darwin-amd64.zip \
670 && mv js/desktop/out/make/zip/darwin/arm64/Streamplace-darwin-arm64-$(VERSION_ELECTRON).zip ./bin/streamplace-desktop-$(VERSION)-darwin-arm64.zip
671
672# link your local version of mist for dev
673.PHONY: link-mist
674link-mist:
675 rm -rf subprojects/mistserver
676 ln -s $$(realpath ../mistserver) ./subprojects/mistserver
677
678# link your local version of gstreamer
679.PHONY: link-gstreamer
680link-gstreamer:
681 rm -rf subprojects/gstreamer-full
682 ln -s $$(realpath ../gstreamer) ./subprojects/gstreamer-full
683
684# link your local version of ffmpeg for dev
685.PHONY: link-ffmpeg
686link-ffmpeg:
687 rm -rf subprojects/FFmpeg
688 ln -s $$(realpath ../ffmpeg) ./subprojects/FFmpeg
689
690# _____ ____ _____ _ ________ _____
691# | __ \ / __ \ / ____| |/ / ____| __ \
692# | | | | | | | | | ' /| |__ | |__) |
693# | | | | | | | | | < | __| | _ /
694# | |__| | |__| | |____| . \| |____| | \ \
695# |_____/ \____/ \_____|_|\_\______|_| \_\
696
697# Actually, Podman. I'm not sure if these commands will actually run on Docker, untested.
698
699.PHONY: docker
700docker:
701 docker build -f docker/local.Dockerfile -t dist.stream.place/streamplace/streamplace:local .
702
703.PHONY: docker-build
704docker-build: docker-build-builder docker-build-in-container
705
706.PHONY: docker-test
707docker-test: docker-build-builder docker-test-in-container
708
709DOCKER_BUILD_OPTS?=
710BUILDER_TARGET?=builder
711.PHONY: docker-build-builder
712docker-build-builder:
713 podman build --target=$(BUILDER_TARGET) --os=linux --arch=amd64 -f docker/build.Dockerfile -t dist.stream.place/streamplace/streamplace:$(BUILDER_TARGET) $(DOCKER_BUILD_OPTS) .
714
715.PHONY: precommit
716precommit: dockerfile-hash-precommit
717
718.PHONY: dockefile-hash-precommit
719dockerfile-hash-precommit:
720 @bash -c 'printf "variables:\n DOCKERFILE_HASH: `git hash-object docker/build.Dockerfile`" > .ci/dockerfile-hash.yaml' \
721 && git add .ci/dockerfile-hash.yaml
722
723# tricks the github action for golangci-lint to run inside a container
724.PHONY: golangci-lint-container
725golangci-lint-container: docker-build-builder
726 podman run \
727 -v $$(pwd):$$(pwd) \
728 -w $$(pwd) \
729 -e PKG_CONFIG_PATH=$$(pwd)/build-linux-amd64/lib/pkgconfig \
730 -d \
731 --name golangci-lint \
732 dist.stream.place/streamplace/streamplace:$(BUILDER_TARGET) \
733 tail -f /dev/null
734 podman exec golangci-lint mkdir -p js/app/dist
735 podman exec golangci-lint touch js/app/dist/index.html
736 podman exec golangci-lint make dev
737
738# runs a command in the build container, building if necessary
739IN_CONTAINER_CMD?=echo 'usage: make in-container IN_CONTAINER_CMD=\"<command>\"'
740DOCKER_BIN?=podman
741DOCKER_REF?=dist.stream.place/streamplace/streamplace:$(BUILDER_TARGET)
742DOCKER_OPTS?=
743.PHONY: in-container
744in-container: docker-build-builder
745 $(DOCKER_BIN) run $(DOCKER_OPTS) -v $$(pwd):$$(pwd) -w $$(pwd) --rm $(DOCKER_REF) bash -c "$(IN_CONTAINER_CMD)"
746
747.PHONY: docker-shell
748docker-shell:
749 $(MAKE) in-container IN_CONTAINER_CMD="bash" DOCKER_OPTS="-it -v $$(pwd):$$(pwd) -w $$(pwd)"
750
751STREAMPLACE_URL?=https://git.stream.place/streamplace/streamplace/-/package_files/10122/download
752.PHONY: docker-release
753docker-release:
754 cd docker \
755 && docker build -f release.Dockerfile \
756 --build-arg TARGETARCH=$(BUILDARCH) \
757 --build-arg STREAMPLACE_URL=$(STREAMPLACE_URL) \
758 -t dist.stream.place/streamplace/streamplace \
759 .
760
761.PHONY: docker-mistserver
762docker-mistserver:
763 cd docker \
764 && docker build -f mistserver.Dockerfile \
765 --build-arg TARGETARCH=$(BUILDARCH) \
766 --build-arg STREAMPLACE_URL=$(STREAMPLACE_URL) \
767 -t dist.stream.place/streamplace/streamplace:mistserver \
768
769# _____ _____ _____ _______ _____ ____
770# | __ \_ _|/ ____|__ __| __ \ / __ \
771# | | | || | | (___ | | | |__) | | | |
772# | | | || | \___ \ | | | _ /| | | |
773# | |__| || |_ ____) | | | | | \ \| |__| |
774# |_____/_____|_____/ |_| |_| \_\\____/
775
776# distro: cut new versions, build apt and brew packages, upload to S3/gitlab
777
778.PHONY: release
779release: install
780 $(MAKE) lexicons
781 pnpm run release
782
783.PHONY: ci-release
784ci-release:
785 go install gitlab.com/gitlab-org/release-cli/cmd/release-cli
786 go run ./pkg/config/git/git.go -release -o release.yml
787 release-cli create-from-file --file release.yml
788
789.PHONY: homebrew
790homebrew:
791 $(MAKE) ci-download-file download_file=streamplace-$(VERSION)-linux-amd64.tar.gz
792 $(MAKE) ci-download-file download_file=streamplace-$(VERSION)-linux-arm64.tar.gz
793 $(MAKE) ci-download-file download_file=streamplace-$(VERSION)-darwin-amd64.tar.gz
794 $(MAKE) ci-download-file download_file=streamplace-$(VERSION)-darwin-arm64.tar.gz
795 git clone git@github.com:streamplace/homebrew-streamplace.git /tmp/homebrew-streamplace
796 go run ./pkg/config/git/git.go -homebrew -o /tmp/homebrew-streamplace/Formula/streamplace.rb
797
798.PHONY: ci-homebrew
799ci-homebrew:
800 git config --global user.name "Streamplace Homebrew Robot"
801 git config --global user.email support@stream.place
802 mkdir -p ~/.ssh
803 echo "Host * \n\
804 StrictHostKeyChecking no \n\
805 UserKnownHostsFile=/dev/null" > ~/.ssh/config
806 echo "$$CI_HOMEBREW_KEY_BASE64" | base64 -d > ~/.ssh/id_ed25519
807 chmod 600 ~/.ssh/id_ed25519
808
809 chmod 600 ~/.ssh/config
810 $(MAKE) homebrew
811 cd /tmp/homebrew-streamplace \
812 && git add . \
813 && git commit -m "Update streamplace $(VERSION)" \
814 && git push
815
816FPM_BASE_OPTS= \
817 -s dir \
818 -t deb \
819 -v $(VERSION_NO_V) \
820 --force \
821 --license=GPL-3.0-or-later \
822 --maintainer="Streamplace <support@stream.place>" \
823 --vendor="Streamplace" \
824 --url="https://stream.place"
825SP_ARCH_NAME?=amd64
826.PHONY: deb-pkg
827deb-pkg:
828 fpm $(FPM_BASE_OPTS) \
829 -n streamplace \
830 -a $(SP_ARCH_NAME) \
831 -p bin/streamplace-$(VERSION)-linux-$(SP_ARCH_NAME).deb \
832 --deb-systemd=util/systemd/streamplace.service \
833 --deb-systemd-restart-after-upgrade \
834 --after-install=util/systemd/after-install.sh \
835 --description="Live video for the AT Protocol. Solving video for everybody forever." \
836 build-linux-$(SP_ARCH_NAME)/streamplace=/usr/bin/streamplace
837
838.PHONY: pkg-linux-amd64
839pkg-linux-amd64:
840 $(MAKE) deb-pkg SP_ARCH_NAME=amd64
841
842.PHONY: pkg-linux-arm64
843pkg-linux-arm64:
844 $(MAKE) deb-pkg SP_ARCH_NAME=arm64
845
846.PHONY: pkg-darwin-amd64
847pkg-darwin-amd64:
848 echo todo
849
850.PHONY: pkg-darwin-arm64
851pkg-darwin-arm64:
852 echo todo
853
854.PHONY: pkg-windows-amd64
855pkg-windows-amd64:
856 echo todo
857
858.PHONY: deb-release
859deb-release:
860 aptly repo create -distribution=all -component=main streamplace-releases
861 aptly mirror create old-version $$S3_PUBLIC_URL/debian all
862 aptly mirror update old-version
863 aptly repo import old-version streamplace-releases streamplace
864 aptly repo add streamplace-releases \
865 bin/streamplace-$(VERSION)-linux-arm64.deb \
866 bin/streamplace-$(VERSION)-linux-amd64.deb
867 aptly snapshot create streamplace-$(VERSION) from repo streamplace-releases
868 aptly publish snapshot -distribution=all streamplace-$(VERSION) s3:streamplace-releases:
869
870.PHONY: ci-deb-release
871ci-deb-release:
872 $(MAKE) ci-download-file download_file=streamplace-$(VERSION)-linux-amd64.deb
873 $(MAKE) ci-download-file download_file=streamplace-$(VERSION)-linux-arm64.deb
874 echo $$CI_SIGNING_KEY_BASE64 | base64 -d | gpg --import
875 gpg --armor --export | gpg --no-default-keyring --keyring trustedkeys.gpg --import
876 echo '{"S3PublishEndpoints":{"streamplace-releases":{"region":"'$$S3_REGION'","bucket":"'$$S3_BUCKET_NAME'","endpoint":"'$$S3_ENDPOINT'","acl":"public-read","prefix":"debian"}}}' > ~/.aptly.conf
877 $(MAKE) deb-release
878
879# _____ _____
880# / ____|_ _|
881# | | | |
882# | | | |
883# | |____ _| |_
884# \_____|_____|
885
886# mostly "do a thing and then gitlab upload the artifact"
887
888.PHONY: ci-upload
889ci-upload: ci-upload-node ci-upload-android
890
891.PHONY: ci-upload-node-linux-amd64
892ci-upload-node-linux-amd64:
893 $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-linux-amd64.tar.gz \
894 && $(MAKE) ci-upload-file upload_file=streamplace-desktop-$(VERSION)-linux-amd64.AppImage \
895 && $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-linux-amd64.deb
896
897.PHONY: ci-upload-node-linux-arm64
898ci-upload-node-linux-arm64:
899 $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-linux-arm64.tar.gz \
900 && $(MAKE) ci-upload-file upload_file=streamplace-desktop-$(VERSION)-linux-arm64.AppImage \
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