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" \
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
204STATIC_OPTS = \
205 $(BASE_OPTS) \
206 -D "gstreamer-full:gst-full-target-type=static_library" \
207 -D "gstreamer:registry=false"
208
209SHARED_OPTS = \
210 $(BASE_OPTS) \
211 -D "FFmpeg:default_library=shared" \
212 -D "gstreamer:registry=true"
213
214.PHONY: meson
215meson:
216 $(MAKE) meson-setup
217 $(MAKE) meson-compile
218
219MESON_SETUP_OPTS?=
220.PHONY: meson-setup
221meson-setup:
222 @meson setup $(BUILDDIR) $(MESON_SETUP_OPTS)
223 @meson configure $(BUILDDIR) $(OPTS)
224
225.PHONY: meson-setup-static
226meson-setup-static:
227 @meson setup $(BUILDDIR) $(MESON_SETUP_OPTS) $(STATIC_OPTS)
228 @meson configure $(BUILDDIR) $(STATIC_OPTS)
229
230.PHONY: meson-compile
231meson-compile:
232 meson install -C $(BUILDDIR)
233
234
235# _____ _______ _______ _____ _____
236# / ____|__ __|/\|__ __|_ _/ ____|
237# | (___ | | / \ | | | || |
238# \___ \ | | / /\ \ | | | || |
239# ____) | | |/ ____ \| | _| || |____
240# |_____/ |_/_/ \_\_| |_____\_____|
241
242# Production distributions of Streamplace with bundled node and app.
243
244static:
245 $(MAKE) meson-setup meson-compile app OPTS=$(STATIC_OPTS) -j16
246 $(MAKE) streamplace
247
248.PHONY: static-test
249static-test:
250 meson test -C $(BUILDDIR) go-tests
251
252# _____ ________ __
253# | __ \| ____\ \ / /
254# | | | | |__ \ \ / /
255# | | | | __| \ \/ /
256# | |__| | |____ \ /
257# |_____/|______| \/
258
259# Local builds of Streamplace with node and app.
260
261.PHONY: dev-setup
262dev-setup:
263 $(MAKE) -j16 app-cached dev-setup-meson
264
265.PHONY: dev
266dev: app-cached
267 if [ ! -d $(BUILDDIR) ]; then $(MAKE) dev-setup; fi
268 cp ./util/streamplace-dev.sh $(BUILDDIR)/streamplace
269 $(MAKE) dev-rust
270 PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) \
271 CGO_LDFLAGS="$(MACOS_VERSION_FLAG)" \
272 LD_LIBRARY_PATH=$(BUILDDIR)/lib go build -o $(BUILDDIR)/libstreamplace ./cmd/libstreamplace/...
273
274.PHONY: dev-setup-meson
275dev-setup-meson:
276 $(MAKE) dev-setup-meson-configure
277 $(MAKE) meson-compile
278
279.PHONY: dev-setup-meson-configure
280dev-setup-meson-configure:
281 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
282 meson setup --default-library=shared $(BUILDDIR) $(SHARED_OPTS)
283 meson configure --default-library=shared $(BUILDDIR) $(SHARED_OPTS)
284
285.PHONY: dev-rust
286dev-rust:
287 cargo build
288 EXT=so; \
289 if [ "$(BUILDOS)" = "darwin" ]; then EXT=dylib; fi; \
290 uniffi-bindgen-go --out-dir pkg/iroh/generated --library ./target/debug/libiroh_streamplace.$$EXT \
291 && cp ./target/debug/libiroh_streamplace.$$EXT $(BUILDDIR)/rust/iroh-streamplace/libiroh_streamplace.$$EXT \
292 && cp ./target/debug/libiroh_streamplace.$$EXT $(BUILDDIR)/lib/libiroh_streamplace.$$EXT
293
294.PHONY: dev-test
295dev-test:
296 PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) \
297 LD_LIBRARY_PATH=$(shell realpath $(BUILDDIR))/lib \
298 go test -p 1 -timeout 300s ./...
299
300# _ _____ _ _ _______ _____ _ _ _____
301# | | |_ _| \ | |__ __|_ _| \ | |/ ____|
302# | | | | | \| | | | | | | \| | | __
303# | | | | | . ` | | | | | | . ` | | |_ |
304# | |____ _| |_| |\ | | | _| |_| |\ | |__| |
305# |______|_____|_| \_| |_| |_____|_| \_|\_____|
306
307.PHONY: check
308check: install
309 $(MAKE) golangci-lint
310 pnpm run check
311 if [ "`gofmt -l . | wc -l`" -gt 0 ]; then echo 'gofmt failed, run make fix'; exit 1; fi
312
313.PHONY: fix
314fix:
315 pnpm run fix
316 gofmt -w .
317
318.PHONY: golangci-lint
319golangci-lint:
320 @PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) \
321 go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint run -c ./.golangci.yaml
322
323# _ ________ _______ _____ ____ _ _ _____
324# | | | ____\ \ / /_ _/ ____/ __ \| \ | |/ ____|
325# | | | |__ \ V / | || | | | | | \| | (___
326# | | | __| > < | || | | | | | . ` |\___ \
327# | |____| |____ / . \ _| || |___| |__| | |\ |____) |
328# |______|______/_/ \_\_____\_____\____/|_| \_|_____/
329
330# Mostly codegen for lexicons.
331
332.PHONY: lexicons
333lexicons:
334 $(MAKE) go-lexicons \
335 && $(MAKE) js-lexicons \
336 && $(MAKE) md-lexicons \
337 && make fix
338
339.PHONY: go-lexicons
340go-lexicons:
341 rm -rf ./pkg/streamplace \
342 && mkdir -p ./pkg/streamplace \
343 && rm -rf ./pkg/streamplace/cbor_gen.go \
344 && $(MAKE) lexgen \
345 && sed -i.bak 's/\tutil/\/\/\tutil/' $$(find ./pkg/streamplace -type f) \
346 && go run golang.org/x/tools/cmd/goimports@latest -w $$(find ./pkg/streamplace -type f) \
347 && go run ./pkg/gen/gen.go \
348 && $(MAKE) lexgen \
349 && find . | grep bak$$ | xargs rm \
350 && rm -rf api
351
352.PHONY: js-lexicons
353js-lexicons:
354 node_modules/.bin/lex gen-api ./js/streamplace/src/lexicons $$(find ./lexicons -type f -name '*.json') --yes \
355 && rm -rf ./js/streamplace/src/lexicons/types/com ./js/streamplace/src/lexicons/types/app \
356 && sed -i.bak "s/^..port.*app\/bsky.*//g" $$(find ./js/streamplace/src/lexicons -type f) \
357 && sed -i.bak "s/^..port.*com\/atproto.*//g" $$(find ./js/streamplace/src/lexicons -type f) \
358 && sed -i.bak "s/\(..port .*\)\.js\(.*\)/\1\2/g" $$(find ./js/streamplace/src/lexicons -type f) \
359 && sed -i.bak 's/AppBskyGraphBlock\.Main/AppBskyGraphBlock\.Record/' $$(find ./js/streamplace/src/lexicons/types/place/stream -type f) \
360 && sed -i.bak 's/PlaceStreamChatProfile\.Main/PlaceStreamChatProfile\.Record/' $$(find ./js/streamplace/src/lexicons/types/place/stream -type f) \
361 && for x in $$(find ./js/streamplace/src/lexicons -type f -name '*.ts'); do \
362 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; \
363 done \
364 && npx prettier --write $$(find ./js/streamplace/src/lexicons -type f -name '*.ts') \
365 && find . | grep bak$$ | xargs rm
366
367.PHONY: md-lexicons
368md-lexicons:
369 pnpm exec lexmd \
370 ./lexicons \
371 .build/temp \
372 subprojects/atproto/lexicons \
373 js/docs/src/content/docs/lex-reference/openapi.json \
374 && ls -R .build/temp \
375 && cp -rf .build/temp/place/stream/* js/docs/src/content/docs/lex-reference/ \
376 && rm -rf .build/temp \
377 && $(MAKE) fix
378
379.PHONY: lexgen
380lexgen:
381 $(MAKE) lexgen-types
382 $(MAKE) lexgen-server
383
384.PHONY: lexgen-types
385lexgen-types:
386 go run github.com/bluesky-social/indigo/cmd/lexgen \
387 -outdir ./pkg/spxrpc \
388 --build-file util/lexgen-types.json \
389 --external-lexicons subprojects/atproto/lexicons \
390 lexicons/place/stream \
391 ./subprojects/atproto/lexicons
392
393.PHONY: lexgen-server
394lexgen-server:
395 mkdir -p ./pkg/spxrpc \
396 && go run github.com/bluesky-social/indigo/cmd/lexgen \
397 --gen-server \
398 --types-import place.stream:stream.place/streamplace/pkg/streamplace \
399 --types-import app.bsky:github.com/bluesky-social/indigo/api/bsky \
400 --types-import com.atproto:github.com/bluesky-social/indigo/api/atproto \
401 --types-import chat.bsky:github.com/bluesky-social/indigo/api/chat \
402 --types-import tools.ozone:github.com/bluesky-social/indigo/api/ozone \
403 -outdir ./pkg/spxrpc \
404 --build-file util/lexgen-types.json \
405 --external-lexicons subprojects/atproto/lexicons \
406 --package spxrpc \
407 lexicons/place/stream \
408 lexicons/app/bsky \
409 lexicons/com/atproto
410
411.PHONY: ci-lexicons
412ci-lexicons:
413 $(MAKE) lexicons \
414 && if ! git diff --exit-code >/dev/null; then echo "lexicons are out of date, run 'make lexicons' to fix"; exit 1; fi
415
416# _______ ______ _____ _______ _____ _ _ _____
417# |__ __| ____|/ ____|__ __|_ _| \ | |/ ____|
418# | | | |__ | (___ | | | | | \| | | __
419# | | | __| \___ \ | | | | | . ` | | |_ |
420# | | | |____ ____) | | | _| |_| |\ | |__| |
421# |_| |______|_____/ |_| |_____|_| \_|\_____|
422
423# test to make sure we haven't added any more dynamic dependencies
424LINUX_LINK_COUNT=5
425.PHONY: link-test-linux
426link-test-linux:
427 count=$(shell ldd ./build-linux-amd64/streamplace | wc -l) \
428 && echo $$count \
429 && if [ "$$count" != "$(LINUX_LINK_COUNT)" ]; then echo "ldd reports new libaries linked! want $(LINUX_LINK_COUNT) got $$count" \
430 && ldd ./build-linux-amd64/streamplace \
431 && exit 1; \
432 fi
433
434MACOS_LINK_COUNT=10
435.PHONY: link-test-macos
436link-test-macos:
437 count=$(shell otool -L ./build-darwin-arm64/streamplace | wc -l | xargs) \
438 && echo $$count \
439 && if [ "$$count" != "$(MACOS_LINK_COUNT)" ]; then echo "otool -L reports new libaries linked! want $(MACOS_LINK_COUNT) got $$count" \
440 && otool -L ./build-darwin-arm64/streamplace \
441 && exit 1; \
442 fi
443
444WINDOWS_LINK_COUNT=19
445.PHONY: link-test-windows
446link-test-windows:
447 count=$(shell x86_64-w64-mingw32-objdump -p ./build-windows-amd64/streamplace.exe | grep "DLL Name" | tr '[:upper:]' '[:lower:]' | sort | uniq | wc -l | xargs) \
448 && echo $$count \
449 && if [ "$$count" != "$(WINDOWS_LINK_COUNT)" ]; then echo "x86_64-w64-mingw32-objdump -p reports new libaries linked! want $(WINDOWS_LINK_COUNT) got $$count" \
450 && x86_64-w64-mingw32-objdump -p ./build-windows-amd64/streamplace.exe | grep "DLL Name" \
451 && exit 1; \
452 fi
453
454.PHONY: ci
455ci: version install app node-all-platforms ci-upload-node
456
457
458.PHONY: ci-desktop-darwin
459ci-desktop-darwin: version install
460 ./util/mac-codesign.sh \
461 && for arch in amd64 arm64; do \
462 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 \
463 && tar -xzvf streamplace-$(VERSION)-darwin-$$arch.tar.gz \
464 && ./streamplace --version \
465 && ./streamplace self-test \
466 && mkdir -p build-darwin-$$arch \
467 && mv ./streamplace ./build-darwin-$$arch/streamplace; \
468 done \
469 && $(MAKE) desktop-darwin \
470 && for arch in amd64 arm64; do \
471 export file=streamplace-desktop-$(VERSION)-darwin-$$arch.zip \
472 && $(MAKE) ci-upload-file upload_file=$$file \
473 && export file=streamplace-desktop-$(VERSION)-darwin-$$arch.dmg \
474 && $(MAKE) ci-upload-file upload_file=$$file; \
475 done
476
477.PHONY: ci-test
478ci-test: app
479 meson setup $(BUILDDIR) $(OPTS)
480 meson test -C $(BUILDDIR) go-tests
481
482.PHONY: ci-npm-release
483ci-npm-release: install
484 echo //registry.npmjs.org/:_authToken=$$NPM_TOKEN > ~/.npmrc \
485 && npx lerna publish from-package --yes
486
487.build/bundletool.jar:
488 mkdir -p .build \
489 && curl -L -o ./.build/bundletool.jar https://github.com/google/bundletool/releases/download/1.17.0/bundletool-all-1.17.0.jar
490
491.PHONY: selftest-macos
492selftest-macos:
493 js/desktop/out/Streamplace-darwin-arm64/Streamplace.app/Contents/MacOS/Streamplace -- --self-test
494
495# _____ _____ ____ _____ _____
496# / ____| __ \ / __ \ / ____/ ____|
497# | | | |__) | | | | (___| (___
498# | | | _ /| | | |\___ \\___ \
499# | |____| | \ \| |__| |____) |___) |
500# \_____|_| \_\\____/|_____/_____/
501# _____ ____ __ __ _____ _____ _ _____ _ _ _____
502# / ____/ __ \| \/ | __ \_ _| | |_ _| \ | |/ ____|
503# | | | | | | \ / | |__) || | | | | | | \| | | __
504# | | | | | | |\/| | ___/ | | | | | | | . ` | | |_ |
505# | |___| |__| | | | | | _| |_| |____ _| |_| |\ | |__| |
506# \_____\____/|_| |_|_| |_____|______|_____|_| \_|\_____|
507
508# Cross-compiling is exclusively right now from linux-amd64 to:
509
510# linux-amd64 (native)
511# linux-arm64
512# windows-amd64
513# darwin-amd64
514# darwin-arm64
515
516.PHONY: node-all-platforms
517node-all-platforms: app
518 meson setup build-linux-amd64 $(OPTS) --buildtype debugoptimized
519 meson compile -C build-linux-amd64 archive
520 $(MAKE) link-test-linux
521 $(MAKE) linux-arm64
522 $(MAKE) windows-amd64
523 $(MAKE) windows-amd64-startup-test
524 $(MAKE) desktop-linux
525 $(MAKE) desktop-windows-amd64
526
527.PHONY: desktop-linux
528desktop-linux:
529 $(MAKE) desktop-linux-amd64
530 $(MAKE) desktop-linux-arm64
531
532.PHONY: desktop-linux-amd64
533desktop-linux-amd64:
534 cd js/desktop \
535 && pnpm run make --platform linux --arch x64 \
536 && cd - \
537 && mv "js/desktop/out/make/AppImage/x64/Streamplace-$(VERSION_ELECTRON)-x64.AppImage" ./bin/streamplace-desktop-$(VERSION)-linux-amd64.AppImage
538
539.PHONY: desktop-linux-arm64
540desktop-linux-arm64:
541 cd js/desktop \
542 && pnpm run make --platform linux --arch arm64 \
543 && cd - \
544 && mv "js/desktop/out/make/AppImage/arm64/Streamplace-$(VERSION_ELECTRON)-arm64.AppImage" ./bin/streamplace-desktop-$(VERSION)-linux-arm64.AppImage
545
546.PHONY: desktop-windows-amd64
547desktop-windows-amd64:
548 cd js/desktop \
549 && pnpm run make --platform win32 --arch x64 \
550 && cd - \
551 && export SUM=$$(cat ./js/desktop/out/make/squirrel.windows/x64/streamplace_desktop-$(VERSION_ELECTRON)-full.nupkg | openssl sha1 | awk '{ print $$2 }') \
552 && echo $$SUM > ./bin/streamplace-desktop-$(VERSION)-windows-amd64.nupkg.sha1 \
553 && mv "js/desktop/out/make/squirrel.windows/x64/streamplace_desktop-$(VERSION_ELECTRON)-full.nupkg" ./bin/streamplace-desktop-$(VERSION)-windows-amd64.$$SUM.nupkg \
554 && mv "js/desktop/out/make/squirrel.windows/x64/Streamplace-$(VERSION_ELECTRON) Setup.exe" ./bin/streamplace-desktop-$(VERSION)-windows-amd64.exe
555
556.PHONY: streamplace
557streamplace: app-cached meson-setup-static
558 meson compile -C $(BUILDDIR) streamplace | grep -v drectve
559
560.PHONY: archive
561archive: app-cached meson-setup-static
562 meson compile -C $(BUILDDIR) archive | grep -v drectve
563
564.PHONY: linux-amd64
565linux-amd64:
566 $(MAKE) -j $(shell nproc) archive
567 $(MAKE) link-test-linux
568
569.PHONY: linux-arm64
570linux-arm64:
571 rustup target add aarch64-unknown-linux-gnu \
572 && CC=aarch64-linux-gnu-gcc \
573 LD=aarch64-linux-gnu-ld \
574 CROSS_COMPILE=1 \
575 MESON_SETUP_OPTS="--cross-file util/linux-arm64-gnu.ini" \
576 BUILDDIR=build-linux-arm64 \
577 CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
578 $(MAKE) -j $(shell nproc) archive
579
580.PHONY: windows-amd64
581windows-amd64:
582 rustup target add x86_64-pc-windows-gnu \
583 && CC=x86_64-w64-mingw32-gcc \
584 LD=x86_64-w64-mingw32-ld \
585 CROSS_COMPILE=1 \
586 MESON_SETUP_OPTS="--cross-file util/windows-amd64-gnu.ini" \
587 BUILDDIR=build-windows-amd64 \
588 $(MAKE) -j $(shell nproc) archive
589
590.PHONY: darwin-amd64
591darwin-amd64:
592 export CC=x86_64-apple-darwin24.4-clang \
593 && export CC_X86_64_APPLE_DARWIN=x86_64-apple-darwin24.4-clang \
594 && export CXX_X86_64_APPLE_DARWIN=x86_64-apple-darwin24.4-clang++ \
595 && export AR_X86_64_APPLE_DARWIN=x86_64-apple-darwin24.4-ar \
596 && export CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=x86_64-apple-darwin24.4-clang \
597 && export LD=x86_64-apple-darwin24.4-ld \
598 && export CROSS_COMPILE=1 \
599 && export MESON_SETUP_OPTS="--cross-file util/osxcross-darwin-amd64.ini" \
600 && export BUILDDIR=build-darwin-amd64 \
601 && $(MAKE) -j $(shell nproc) streamplace \
602 && ./util/osxcross-codesign.sh ./build-darwin-amd64/streamplace \
603 && mkdir -p bin \
604 && cd build-darwin-amd64 \
605 && tar -czvf ../bin/streamplace-$(VERSION)-darwin-amd64.tar.gz ./streamplace \
606 && cd -
607
608.PHONY: darwin-arm64
609darwin-arm64:
610 export CC=aarch64-apple-darwin24.4-clang \
611 && export CC_AARCH64_APPLE_DARWIN=aarch64-apple-darwin24.4-clang \
612 && export CXX_AARCH64_APPLE_DARWIN=aarch64-apple-darwin24.4-clang++ \
613 && export AR_AARCH64_APPLE_DARWIN=aarch64-apple-darwin24.4-ar \
614 && export CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER=aarch64-apple-darwin24.4-clang \
615 && export LD=aarch64-apple-darwin24.4-ld \
616 && export CROSS_COMPILE=1 \
617 && export MESON_SETUP_OPTS="--cross-file util/osxcross-darwin-arm64.ini" \
618 && export BUILDDIR=build-darwin-arm64 \
619 && $(MAKE) -j $(shell nproc) streamplace \
620 && ./util/osxcross-codesign.sh ./build-darwin-arm64/streamplace \
621 && mkdir -p bin \
622 && cd build-darwin-arm64 \
623 && tar -czvf ../bin/streamplace-$(VERSION)-darwin-arm64.tar.gz ./streamplace \
624 && cd -
625
626# unbuffer here is a workaround for wine trying to pop up a terminal window and failing
627.PHONY: windows-amd64-startup-test
628windows-amd64-startup-test:
629 bash -c 'set -euo pipefail && unbuffer wine64 ./build-windows-amd64/streamplace.exe self-test | cat'
630
631.PHONY: desktop-darwin-amd64
632desktop-darwin-amd64:
633 echo "TODO"
634
635.PHONY: desktop-darwin-arm64
636desktop-darwin-arm64:
637 echo "TODO"
638
639.PHONY: desktop-darwin
640desktop-darwin:
641 export DEBUG="electron-osx-sign*" \
642 && cd js/desktop \
643 && pnpm run make --platform darwin --arch arm64 \
644 && pnpm run make --platform darwin --arch x64 \
645 && cd - \
646 && mv js/desktop/out/make/Streamplace-$(VERSION_ELECTRON)-x64.dmg ./bin/streamplace-desktop-$(VERSION)-darwin-amd64.dmg \
647 && mv js/desktop/out/make/Streamplace-$(VERSION_ELECTRON)-arm64.dmg ./bin/streamplace-desktop-$(VERSION)-darwin-arm64.dmg \
648 && mv js/desktop/out/make/zip/darwin/x64/Streamplace-darwin-x64-$(VERSION_ELECTRON).zip ./bin/streamplace-desktop-$(VERSION)-darwin-amd64.zip \
649 && mv js/desktop/out/make/zip/darwin/arm64/Streamplace-darwin-arm64-$(VERSION_ELECTRON).zip ./bin/streamplace-desktop-$(VERSION)-darwin-arm64.zip
650
651# link your local version of mist for dev
652.PHONY: link-mist
653link-mist:
654 rm -rf subprojects/mistserver
655 ln -s $$(realpath ../mistserver) ./subprojects/mistserver
656
657# link your local version of c2pa-go for dev
658.PHONY: link-c2pa-go
659link-c2pa-go:
660 rm -rf subprojects/c2pa_go
661 ln -s $$(realpath ../c2pa-go) ./subprojects/c2pa_go
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)";