Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ The GitHub workflow will fail initially because the jobs which test the installe
Releasing a new version is a three-step process:

1. Bump the version in `[file:Cargo.toml]`, run `cargo build` to update `[file:Cargo.lock]`, and update `[file:CHANGELOG.md]` with information about the new version. Ship those changes as a single commit.
2. Once the GitHub workflow has finished on the `main` branch, update the version in `[file:install.sh]` to point to the new release. Also, update the `rev` in the example pre-commit configuration in `[file:README.md]` to point to the new version.
2. Once the GitHub workflow has finished on the `main` branch, the installation script will begin installing the new release by default. Update the `rev` in the example pre-commit configuration in `[file:README.md]` to point to the new version.
3. Create a pull request in the `Homebrew/homebrew-core` repository on GitHub to bump the version in [this file](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/t/tagref.rb).
14 changes: 8 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
# Where the binary will be installed
DESTINATION="${PREFIX:-/usr/local/bin}/tagref"

# Which version to download
RELEASE="v${VERSION:-1.13.0}"

# Determine which binary to download.
FILENAME=''
if uname -a | grep -qi 'x86_64.*GNU/Linux'; then
Expand Down Expand Up @@ -56,10 +53,15 @@
# Compute the full file path.
SOURCE="$TEMPDIR/$FILENAME"

# Download the requested version, or the latest published version by default.
if [ -n "${VERSION:-}" ]; then
DOWNLOAD_URL="https://github.com/stepchowfun/tagref/releases/download/v$VERSION/$FILENAME"
else
DOWNLOAD_URL="https://github.com/stepchowfun/tagref/releases/latest/download/$FILENAME"
fi

# Download the binary.
curl \
"https://github.com/stepchowfun/tagref/releases/download/$RELEASE/$FILENAME" \
-o "$SOURCE" -LSf || fail 'There was an error downloading the binary.'
curl "$DOWNLOAD_URL" -o "$SOURCE" -LSf || fail 'There was an error downloading the binary.'

# Make it executable.
chmod a+x "$SOURCE" || fail 'There was an error setting the permissions for the binary.'
Expand Down