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
56 changes: 56 additions & 0 deletions .github/workflows/tagged-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Tagged Release

on:
push:
tags:
- "v*"

permissions:
contents: write

jobs:
release:
name: Publish tagged release
runs-on: depot-ubuntu-24.04-4
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Run tests
run: go test ./...

- name: Build release binaries
run: |
set -euo pipefail
mkdir -p dist
BUILD_DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
VERSION="${GITHUB_REF_NAME#v}"
for GOOS in darwin linux windows; do
for GOARCH in amd64 arm64; do
OUT="dist/wherobots_${GOOS}_${GOARCH}"
if [ "${GOOS}" = "windows" ]; then
OUT="${OUT}.exe"
fi
echo "Building ${OUT}"
GOOS="${GOOS}" GOARCH="${GOARCH}" CGO_ENABLED=0 \
go build -ldflags "-s -w -X main.buildVersion=${VERSION} -X main.commit=${GITHUB_SHA} -X main.date=${BUILD_DATE}" -o "${OUT}" .
done
done
(cd dist && sha256sum * > checksums.txt)

- name: Create GitHub release
run: |
set -euo pipefail
gh release create "${GITHUB_REF_NAME}" dist/* \
--title "Release ${GITHUB_REF_NAME}" \
--generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion internal/commands/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

const (
upgradeRepo = "wherobots/wbc-cli"
upgradeDefaultTag = "latest-prerelease"
upgradeDefaultTag = "latest"
upgradeBinary = "wherobots"
)

Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ func run(ctx context.Context) error {
if result := version.Collect(updateCh); result != nil {
fmt.Fprintln(os.Stderr, "")
fmt.Fprintln(os.Stderr, version.FormatNotice(result))
if execErr != nil {
fmt.Fprintln(os.Stderr, "Note: your CLI is out of date. Run `wherobots upgrade` to update — it may resolve this issue.")
Comment thread
ClayMav marked this conversation as resolved.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think FormatNotice kinda has this, but I'm not really sure.

}
}

return execErr
Expand Down
4 changes: 2 additions & 2 deletions scripts/install-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -euo pipefail

REPO="${WHEROBOTS_CLI_REPO:-wherobots/wbc-cli}"
TAG="${WHEROBOTS_CLI_TAG:-latest-prerelease}"
TAG="${WHEROBOTS_CLI_TAG:-latest}"
BINARY_NAME="${WHEROBOTS_CLI_BINARY:-wherobots}"
INSTALL_DIR="${INSTALL_DIR:-${HOME}/.local/bin}"
SKIP_CHECKSUM=0
Expand All @@ -19,7 +19,7 @@ Usage:

Options:
--repo <owner/name> GitHub repository (default: wherobots/wbc-cli)
--tag <tag> Release tag (default: latest-prerelease)
--tag <tag> Release tag (default: latest)
--install-dir <path> Install directory (default: ~/.local/bin)
--binary-name <name> Binary name/asset prefix (default: wherobots)
--skip-checksum Skip checksum verification
Expand Down
Loading