Live video on the AT Protocol

add semver release process

Changelog: added
See merge request aquareum-tv/aquareum!37

+122 -7
+2
.gitignore
··· 10 10 !.yarn/versions 11 11 .build 12 12 .wrangler 13 + description.md 14 + lerna-debug.log
+10 -2
.gitlab-ci.yml
··· 38 38 - git fetch --unshallow || echo 'already unshallow' 39 39 - make ci-macos 40 40 41 - # variables: 42 - # TART_EXECUTOR_HOST_DIR: "true" 41 + release: 42 + stage: build 43 + image: "$CI_REGISTRY_IMAGE:builder-$CI_COMMIT_SHA" 44 + needs: 45 + - build-mac 46 + - build 47 + rules: 48 + - if: '$CI_COMMIT_TAG =~ /^v?\d+\.\d+\.\d+$/' 49 + script: 50 + - make ci-release
+15 -1
Makefile
··· 126 126 --fail-with-body \ 127 127 --header "JOB-TOKEN: $$CI_JOB_TOKEN" \ 128 128 --upload-file bin/$(upload_file) \ 129 - "$$CI_API_V4_URL/projects/$$CI_PROJECT_ID/packages/generic/$(shell echo $$CI_COMMIT_BRANCH | sed 's/\//-/')/$(VERSION)/$(upload_file)"; 129 + "$$CI_API_V4_URL/projects/$$CI_PROJECT_ID/packages/generic/$(shell ./util/branch.sh)/$(VERSION)/$(upload_file)"; 130 + 131 + .PHONY: release 132 + release: 133 + yarn run release 134 + 135 + .PHONY: ci-release 136 + ci-release: 137 + go install gitlab.com/gitlab-org/release-cli/cmd/release-cli 138 + curl --silent --fail "$$CI_API_V4_URL/projects/$$CI_PROJECT_ID/repository/changelog?version=$(VERSION)" | jq -r '.notes' > description.md 139 + release-cli create \ 140 + --name $(VERSION) \ 141 + --tag-name $(VERSION) \ 142 + --description description.md \ 143 + --assets-link '$(shell ./util/release-files.sh $(VERSION))' 130 144 131 145 .PHONY: check 132 146 check:
+2 -2
docker/build.Dockerfile
··· 6 6 ENV GO_VERSION 1.22.4 7 7 ENV NODE_VERSION 22.3.0 8 8 9 - RUN apt update && apt install -y build-essential curl git openjdk-17-jdk unzip 9 + RUN apt update && apt install -y build-essential curl git openjdk-17-jdk unzip jq 10 10 RUN curl -L --fail https://go.dev/dl/go$GO_VERSION.linux-$TARGETARCH.tar.gz -o go.tar.gz \ 11 11 && tar -C /usr/local -xf go.tar.gz \ 12 12 && rm go.tar.gz 13 - ENV PATH $PATH:/usr/local/go/bin 13 + ENV PATH $PATH:/usr/local/go/bin:/root/go/bin 14 14 15 15 RUN export NODEARCH="$TARGETARCH" \ 16 16 && if [ "$TARGETARCH" = "amd64" ]; then export NODEARCH="x64"; fi \
+15
go.mod
··· 13 13 github.com/peterbourgon/ff/v3 v3.3.1 14 14 github.com/samber/slog-http v1.4.0 15 15 github.com/stretchr/testify v1.9.0 16 + gitlab.com/gitlab-org/release-cli v0.18.0 16 17 golang.org/x/sync v0.6.0 17 18 gorm.io/driver/sqlite v1.5.5 18 19 ) ··· 33 34 ) 34 35 35 36 require ( 37 + github.com/BurntSushi/toml v0.3.1 // indirect 38 + github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect 39 + github.com/cyphar/filepath-securejoin v0.2.4 // indirect 40 + github.com/hashicorp/errwrap v1.1.0 // indirect 41 + github.com/hashicorp/go-multierror v1.1.1 // indirect 42 + github.com/hashicorp/go-version v1.4.0 // indirect 43 + github.com/jstemmer/go-junit-report v1.0.0 // indirect 44 + github.com/mitchellh/gox v1.0.1 // indirect 45 + github.com/mitchellh/iochan v1.0.0 // indirect 46 + github.com/russross/blackfriday/v2 v2.1.0 // indirect 47 + github.com/sirupsen/logrus v1.8.1 // indirect 48 + github.com/stretchr/objx v0.5.2 // indirect 49 + github.com/urfave/cli/v2 v2.4.0 // indirect 36 50 go.opentelemetry.io/otel v1.19.0 // indirect 37 51 go.opentelemetry.io/otel/trace v1.19.0 // indirect 52 + gopkg.in/yaml.v2 v2.4.0 // indirect 38 53 )
+35
go.sum
··· 1 + github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= 2 + github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 1 3 github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= 2 4 github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= 3 5 github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls= 4 6 github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E= 7 + github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU= 8 + github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= 9 + github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= 10 + github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= 5 11 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 6 12 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 7 13 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= ··· 13 19 github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 14 20 github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= 15 21 github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 22 + github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 23 + github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= 24 + github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 25 + github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= 26 + github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= 27 + github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= 28 + github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca1L0J4= 29 + github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= 16 30 github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= 17 31 github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= 18 32 github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= 19 33 github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= 34 + github.com/jstemmer/go-junit-report v1.0.0 h1:8X1gzZpR+nVQLAht+L/foqOeX2l9DTZoaIPbEQHxsds= 35 + github.com/jstemmer/go-junit-report v1.0.0/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= 20 36 github.com/lmittmann/tint v1.0.4 h1:LeYihpJ9hyGvE0w+K2okPTGUdVLfng1+nDNVR4vWISc= 21 37 github.com/lmittmann/tint v1.0.4/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE= 22 38 github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= 23 39 github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 24 40 github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= 25 41 github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= 42 + github.com/mitchellh/gox v1.0.1 h1:x0jD3dcHk9a9xPSDN6YEL4xL6Qz0dvNYm8yZqui5chI= 43 + github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4= 44 + github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= 45 + github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= 26 46 github.com/orandin/slog-gorm v1.3.2 h1:C0lKDQPAx/pF+8K2HL7bdShPwOEJpPM0Bn80zTzxU1g= 27 47 github.com/orandin/slog-gorm v1.3.2/go.mod h1:MoZ51+b7xE9lwGNPYEhxcUtRNrYzjdcKvA8QXQQGEPA= 28 48 github.com/peterbourgon/ff/v3 v3.3.1 h1:XSWvXxeNdgeppLNGGJEAOiXRdX2YMF/LuZfdnqQ1SNc= 29 49 github.com/peterbourgon/ff/v3 v3.3.1/go.mod h1:zjJVUhx+twciwfDl0zBcFzl4dW8axCRyXE/eKY9RztQ= 30 50 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 31 51 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 52 + github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= 53 + github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 32 54 github.com/samber/slog-http v1.4.0 h1:s2hSzMlQBFDIPTUBDm6G+SGfv7F4xR9q8edjxtY6aho= 33 55 github.com/samber/slog-http v1.4.0/go.mod h1:n6h4x2ZBeTgLqMKf95EuNlU6mcJF1b/RVLxo1od5+V0= 56 + github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= 57 + github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= 34 58 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 59 + github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= 60 + github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= 61 + github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 35 62 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 36 63 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 37 64 github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= 38 65 github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= 66 + github.com/urfave/cli/v2 v2.4.0 h1:m2pxjjDFgDxSPtO8WSdbndj17Wu2y8vOT86wE/tjr+I= 67 + github.com/urfave/cli/v2 v2.4.0/go.mod h1:NX9W0zmTvedE5oDoOMs2RTC8RvdK98NTYZE5LbaEYPg= 68 + gitlab.com/gitlab-org/release-cli v0.18.0 h1:vVNxGRIy4w4FIo0ucO8ZyYecSH+jwV+vdZygpBt+E/0= 69 + gitlab.com/gitlab-org/release-cli v0.18.0/go.mod h1:VRzoYTcZ/1CgyaQBKbz0LIfjigKGUh0leWA1f1cLAFc= 39 70 go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= 40 71 go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= 41 72 go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= 42 73 go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= 43 74 golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= 44 75 golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 76 + golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 45 77 golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 46 78 golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 47 79 golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= 48 80 golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 49 81 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 50 82 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 83 + gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 84 + gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 85 + gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 51 86 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 52 87 gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 53 88 gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+2 -1
package.json
··· 10 10 "fix": "git ls-files | xargs prettier --write --ignore-unknown", 11 11 "postinstall": "husky && yarn run build", 12 12 "build": "yarn workspaces foreach --all run build", 13 - "prepare": "husky" 13 + "prepare": "husky", 14 + "release": "lerna publish --force-publish" 14 15 }, 15 16 "keywords": [], 16 17 "author": "Aquareum",
+15
util/branch.sh
··· 1 + #!/bin/bash 2 + 3 + # prints out current version from CI variables 4 + 5 + set -euo pipefail 6 + 7 + echoerr() { printf "%s\n" "$*" >&2; } 8 + if [[ ${CI_COMMIT_TAG:-} != "" ]]; then 9 + echo "latest" 10 + elif [[ ${CI_COMMIT_BRANCH:-} != "" ]]; then 11 + echo $CI_COMMIT_BRANCH | sed 's/\//-/' 12 + else 13 + echoerr "CI_COMMIT_TAG and CI_COMMIT_BRANCH undefined, can't get branch" 14 + exit 1 15 + fi
+12
util/release-files.sh
··· 1 + #!/bin/bash 2 + 3 + # gets all the files for a release version 4 + 5 + set -euo pipefail 6 + set -x 7 + 8 + VERSION="$1" 9 + 10 + id="$(curl --silent --fail "$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages?package_version=$VERSION" | jq -r '.[0].id')" 11 + files="$(curl --silent --fail "$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/$id/package_files")" 12 + echo $files | jq -c '[.[] | {"name": .file_name, "url": ("'$CI_API_V4_URL'/projects/'$CI_PROJECT_ID'/packages/generic/latest/'$VERSION'/" + .file_name)}]'
+9
util/tools.go
··· 1 + //go:build tools 2 + 3 + package main 4 + 5 + import ( 6 + _ "gitlab.com/gitlab-org/release-cli/cmd/release-cli" 7 + ) 8 + 9 + // This file just exists so we can `go install` stuff with pinned versions later
+5 -1
util/version.sh
··· 4 4 5 5 set -euo pipefail 6 6 7 - git describe --long --tags --dirty | sed 's/-[0-9]*-g/-/' 7 + if [[ ${CI_COMMIT_TAG:-} != "" ]]; then 8 + echo "$CI_COMMIT_TAG" 9 + else 10 + git describe --long --tags --dirty | sed 's/-[0-9]*-g/-/' 11 + fi