Skip to content
This repository was archived by the owner on Apr 26, 2026. It is now read-only.
Closed
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
14 changes: 11 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,20 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Build for ${{ matrix.goos }}/${{ matrix.goarch }}
- name: Build bridge for ${{ matrix.goos }}/${{ matrix.goarch }}
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
VERSION: ${{ needs.version.outputs.new_version }}
run: sh build.sh
run: |
# v3.7.0 is the end-of-life Canasta-CLI Go release. The repo's
# full Cobra build (build.sh, cmd/, internal/) is preserved as
# archived dead code — releases from this point ship only the
# minimal bridge program from ./bridge, which prints a notice
# directing users to install Canasta CLI 4.0.0+ via
# get.canasta.wiki. See bridge/main.go for full context.
mkdir -p build
go build -trimpath -ldflags="-s -w" \
-o build/canasta-${{ matrix.goos }}-${{ matrix.goarch }} ./bridge
- name: Upload executable
uses: actions/upload-artifact@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

# Build output directory
build/
dist/

# Test binary, built with `go test -c`
*.test
Expand Down
22 changes: 20 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,26 @@ install: build

clean:
@echo "Cleaning build artifacts..."
@rm -rf build/
@rm -rf build/ dist/
@echo "Clean complete."

# Cross-compile the Go-to-Ansible bridge for the four selfupdate-supported
# OS/arch combos. Output goes to dist/bridge/canasta-<os>-<arch>; those
# files become release assets on this repo's v3.7.0 release and are
# vendored into the Canasta-Ansible repo for re-use on every Canasta CLI
# 4.x.x release. See https://github.com/CanastaWiki/Canasta-Ansible/blob/main/canasta-ansible-release-plan.md
# for the full release plan.
bridge:
@mkdir -p dist/bridge
@for platform in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64; do \
os=$${platform%%/*}; arch=$${platform##*/}; \
echo "Building bridge for $$os/$$arch..."; \
GOOS=$$os GOARCH=$$arch go build -trimpath -ldflags="-s -w" \
-o dist/bridge/canasta-$$os-$$arch ./bridge; \
done
@echo "Bridge binaries built in dist/bridge/"
@ls -lh dist/bridge/

prepare-lint:
@if ! hash golangci-lint 2>/dev/null; then printf "\e[1;36m>> Installing golangci-lint (this may take a while)...\e[0m\n"; go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest; fi

Expand Down Expand Up @@ -55,6 +72,7 @@ help:
@printf "\e[1mBuild\e[0m\n"
@printf " \e[36mbuild\e[0m Build binary (outputs to build/ directory and creates symlink).\n"
@printf " \e[36minstall\e[0m Build and install to /usr/local/bin/ (requires sudo).\n"
@printf " \e[36mbridge\e[0m Cross-compile the Go-to-Ansible bridge for 4 OS/arch combos (outputs to dist/bridge/).\n"
@printf " \e[36mclean\e[0m Remove build artifacts and symlink.\n"
@printf "\n"
@printf "\e[1mTest\e[0m\n"
Expand All @@ -67,4 +85,4 @@ help:
@printf " \e[36mcoverage-report\e[0m Merge unit and integration profiles and show combined coverage.\n"
@printf "\n"

.PHONY: build install clean prepare-lint lint test-cover integration-cover coverage-report help
.PHONY: build install clean bridge prepare-lint lint test-cover integration-cover coverage-report help
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.3
3.7.0
40 changes: 40 additions & 0 deletions bridge/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Package main is the Canasta-CLI Go-to-Ansible bridge.
//
// Old Canasta-CLI Go binaries' selfupdate logic is hardcoded to query
// api.github.com/repos/CanastaWiki/Canasta-CLI/releases/latest and
// download canasta-<os>-<arch> from whichever release is "latest."
// Attaching this minimal bridge as a release asset (a) to v3.7.0 of
// this repo, and (b) to every release of the Ansible-based Canasta CLI
// (the renamed Canasta-Ansible repo, which now occupies the
// "Canasta-CLI" slot on GitHub) keeps the migration path working
// indefinitely.
//
// Any invocation of this binary prints the migration message and
// exits. Once installed via the old binary's selfupdate, running any
// canasta command becomes a forcing function for the user to run the
// install script.
package main

import "fmt"

func main() {
fmt.Println(`The Go implementation of Canasta CLI that you have been using has been superseded by a python/Ansible implementation (version 4.0.0+).

Your registered instances and their data continue to work without changes.

To install the new Canasta CLI, run ONE of:

# Docker mode (default — only Docker required on the host):
curl -fsSL https://get.canasta.wiki | bash

# Native mode (requires Python 3.10+ and git on the host;
# Ansible is installed automatically into a Python venv):
curl -fsSL https://get.canasta.wiki | bash -s -- --native

Docker mode is the simplest setup. Native mode runs Ansible directly
on the host (faster startup, easier playbook debugging).

See https://canasta.wiki/wiki/Help:Installation for details.

After install, run 'canasta version' to confirm you're on 4.0.0 or later.`)
}
Loading