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
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ jobs:
go-version: '1.25' # Ensure this matches your project's Go version
cache: true

- name: Build all architectures
run: make release

- name: Create GitHub Release and Upload Assets
uses: softprops/action-gh-release@v2
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
files: build/*
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}

docker-release:
runs-on: ubuntu-latest
Expand Down
78 changes: 78 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
version: 2
project_name: amqcli

before:
hooks:
- go mod tidy

builds:
- id: amqcli
main: ./cmd/main.go
binary: amqcli
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
ldflags:
- -s -w -X main.Version={{.Version}}

- id: amqcli-aix
main: ./cmd/main.go
binary: amqcli
env:
- CGO_ENABLED=0
- GOPPC64=power8
goos:
- aix
goarch:
- ppc64
ldflags:
- -w -X main.Version={{.Version}}

archives:
- format: tar.gz
name_template: >-
{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}
format_overrides:
- goos: windows
format: zip

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ incpatch .Version }}-next"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

brews:
- name: amqcli
repository:
owner: xvlet
name: homebrew-amqcli
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"

commit_author:
name: goreleaserbot
email: bot@goreleaser.com

directory: Formula

homepage: "https://github.com/xvlet/amqcli"
description: "ActiveMQ TUI Client - Manage and monitor ActiveMQ queues and messages via terminal"

install: |
bin.install "amqcli"

test: |
system "#{bin}/amqcli", "--version"
11 changes: 11 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"flag"
"fmt"
"log"

"github.com/xvlet/amqcli/adapter/inbound/ui"
Expand All @@ -13,10 +14,20 @@ import (
tea "github.com/charmbracelet/bubbletea"
)

var (
Version = "dev"
)

func main() {
env := flag.String("env", "dev", "Environment profile to use (e.g. dev, prod)")
showVersion := flag.Bool("version", false, "Print application version")
flag.Parse()

if *showVersion {
fmt.Printf("amqcli version %s\n", Version)
return
}

// 1. Load config
cfg, err := config.LoadConfig("config.yml")
if err != nil {
Expand Down
Loading