forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease-homebrew.sh
More file actions
executable file
·36 lines (26 loc) · 928 Bytes
/
release-homebrew.sh
File metadata and controls
executable file
·36 lines (26 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
set -euo pipefail
# release-homebrew.sh
#
# SUMMARY
#
# Releases latest version to the timberio homebrew tap
td="$(mktemp -d)"
pushd "$td"
git config --global user.email "bradybot@timber.io"
git config --global user.name "bradybot"
git clone "https://$GITHUB_TOKEN:x-oauth-basic@github.com/timberio/homebrew-brew"
cd homebrew-brew
PACKAGE_URL="https://packages.timber.io/vector/$VECTOR_VERSION/vector-$VECTOR_VERSION-x86_64-apple-darwin.tar.gz"
PACKAGE_SHA256=$(curl -s "$PACKAGE_URL" | sha256sum | cut -d " " -f 1)
update-content() {
sed "s|url \".*\"|url \"$PACKAGE_URL\"|" \
| sed "s|sha256 \".*\"|sha256 \"$PACKAGE_SHA256\"|" \
| sed "s|version \".*\"|version \"$VECTOR_VERSION\"|"
}
NEW_CONTENT="$(update-content < Formula/vector.rb)"
echo "$NEW_CONTENT" > Formula/vector.rb
git diff-index --quiet HEAD || git commit -am "Release Vector $VECTOR_VERSION"
git push
popd
rm -rf "$td"