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