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