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