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