d10ab88444
This diff modifies all the github actions that produce assets to publish on a release called rolling when we are not building a tag. If everything goes as planned, we should be able to provide people with automatically generated fresh binaries for testing. While there, introduce caching for all builds to make them as fast as possible. I suspect gomobile based builds will not see any speed up but other builds most likely will. See https://github.com/ooni/probe/issues/2249
29 lines
563 B
Bash
Executable File
29 lines
563 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
# 1. obtain the github ref of this action run
|
|
__ref=${GITHUB_REF:-}
|
|
|
|
if [[ $__ref == "" ]]; then
|
|
echo "FATAL: missing github ref" 1>&2
|
|
exit 1
|
|
fi
|
|
|
|
# 2. determine whether to publish to a release or to rolling
|
|
if [[ $__ref =~ ^refs/tags/v ]]; then
|
|
__version=${__ref#refs/tags/v}
|
|
else
|
|
__version=rolling
|
|
fi
|
|
|
|
set -x
|
|
|
|
# 3. make sure we're using the correct go version
|
|
./CLI/check-go-version
|
|
|
|
# 4. generate the actual tarball
|
|
go mod vendor
|
|
tar -czf ooni-probe-cli-${__version}.tar.gz --transform "s,^,ooni-probe-cli-${__version}/," *
|
|
|