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