mirror of
https://github.com/coder/code-server.git
synced 2024-12-04 23:03:06 +08:00
8316a27da4
* fix: source lib.sh in docker-buildx-push for tagging version
* chore: use ubuntu and update git config homebrew job
* refactor: simplify brew-bump.sh script
* Revert "fix: source lib.sh in docker-buildx-push for tagging version"
This reverts commit 2f7a3610cb
.
38 lines
959 B
Bash
Executable File
38 lines
959 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
main() {
|
|
# Only sourcing this so we get access to $VERSION
|
|
source ./ci/lib.sh
|
|
source ./ci/steps/steps-lib.sh
|
|
|
|
echo "Checking environment variables"
|
|
|
|
# We need VERSION to bump the brew formula
|
|
if ! is_env_var_set "VERSION"; then
|
|
echo "VERSION is not set"
|
|
exit 1
|
|
fi
|
|
|
|
# We need HOMEBREW_GITHUB_API_TOKEN to push up commits
|
|
if ! is_env_var_set "HOMEBREW_GITHUB_API_TOKEN"; then
|
|
echo "HOMEBREW_GITHUB_API_TOKEN is not set"
|
|
exit 1
|
|
fi
|
|
|
|
# Find the docs for bump-formula-pr here
|
|
# https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dev-cmd/bump-formula-pr.rb#L18
|
|
local output
|
|
if ! output=$(brew bump-formula-pr --version="${VERSION}" code-server --no-browse --no-audit 2>&1); then
|
|
if [[ $output == *"Duplicate PRs should not be opened"* ]]; then
|
|
echo "$VERSION is already submitted"
|
|
exit 0
|
|
else
|
|
echo "$output"
|
|
exit 1
|
|
fi
|
|
fi
|
|
}
|
|
|
|
main "$@"
|