Live video on the AT Protocol
79
fork

Configure Feed

Select the types of activity you want to include in your feed.

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