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