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