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
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: "1.26.6"
go-version: "1.27.1"
cache: true

- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.12.2
version: v2.14.0

- name: test
run: make test

- name: build
run: make build

- name: build-all (cross-compile matrix)
run: make build-all
- name: validate GoReleaser config
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: check
20 changes: 9 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-go@v5
with:
go-version: "1.26.6"
go-version: "1.27.1"
cache: true

- name: build release artifacts
run: make release

- name: publish GitHub release
- name: GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ github.ref_name }}" \
dist/eds-* dist/checksums.txt \
--title "${{ github.ref_name }}" \
--generate-notes
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53 changes: 53 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: 2

project_name: eds

before:
hooks:
- go mod tidy

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

archives:
- id: eds
name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"
formats:
- binary
files:
# Only the binary; no README, LICENSE, etc.
- none*

checksum:
name_template: "checksums.txt"
algorithm: sha256

snapshot:
version_template: "{{ .Version }}-{{ .ShortCommit }}"

release:
draft: true

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^ci:"
- "^chore:"
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ the API client and printer.
stderr by `cmd.Execute()` (root sets `SilenceUsage`/`SilenceErrors`) — keep
error messages one line and actionable (see `requireAPIKey`'s message as
the template).
- Target platforms are Linux + macOS only (`DEFAULT_OSES := darwin linux` in
the Makefile); don't add Windows-specific code paths without updating that.
- Target platforms are Linux + macOS + Windows (`DEFAULT_OSES := darwin linux windows` in
the Makefile).
- If you ever scaffold a `Dockerfile` for a Workflow Studio deploy test
(fixtures, examples, docs), it must run as non-root with a read-only-ish
root filesystem -- that's what the Container Apps runtime enforces.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cd evolution-devservices-cli
make build # ./bin/eds
```

Go 1.22+ is required. Target platforms are Linux + macOS only.
Go 1.27+ is required. Target platforms are Linux + macOS + Windows.

Useful targets:

Expand Down
37 changes: 11 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
# Makefile for the Evolution DevServices CLI (eds).
#
# Targets:
# make build - build for the current GOOS/GOARCH into ./bin/eds
# make build-all - cross-compile the default matrix into ./dist/
# make build-one - helper invoked by build-all (GOOS=... GOARCH=...)
# make clean - remove ./bin and ./dist
# make test - run `go test ./...`
# make tidy - run `go mod tidy`
# make install - `go install` into $GOBIN
# make release - build-all + sha256 sums
# make upload - build-all + publish to S3-compatible storage
# make upload-latest - only update the `latest` pointer in the bucket
# make help - print the list of targets
#
# GitHub Releases (primary distribution channel) are cut manually or via CI
# with `gh release create <tag> dist/* --generate-notes` after `make release`.
# `make upload`/`make upload-latest` are for an optional secondary mirror on
# S3-compatible storage.
#
# Overrides:
# make build-all OSES="linux darwin" ARCHS="amd64 arm64"
# make build VERSION=v0.2.0
# make upload BUCKET=my-bucket PREFIX=evolution-devservices-cli VERSION=v0.2.0

BINARY := eds
PKG := github.com/cloud-ru/evolution-devservices-cli
BUILD_DIR := bin
Expand Down Expand Up @@ -149,6 +124,14 @@ upload-latest:
rm -f $(DIST_DIR)/.latest && \
echo " ✔ latest -> $(VERSION)"

.PHONY: goreleaser-build
goreleaser-build: clean
goreleaser build --snapshot --clean

.PHONY: goreleaser-release
goreleaser-release: clean
goreleaser release --clean

.PHONY: install
install:
CGO_ENABLED=$(CGO_ENABLED) go install $(GOFLAGS) \
Expand All @@ -172,7 +155,9 @@ help:
@echo " build build for the current platform into ./bin/"
@echo " build-all cross-compile darwin/linux/windows × amd64/arm64 into ./dist/"
@echo " build-one helper for build-all (GOOS=... GOARCH=...)"
@echo " release build-all + sha256 checksums"
@echo " goreleaser-build local snapshot build via GoReleaser (into ./dist/)"
@echo " goreleaser-release full release via GoReleaser (requires a git tag)"
@echo " release build-all + sha256 checksums (legacy)"
@echo " upload build-all + publish to S3 (BUCKET=... VERSION=...)"
@echo " upload-latest only update the 'latest' pointer in the bucket"
@echo " install go install into \$$GOBIN"
Expand Down
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ go install github.com/cloud-ru/evolution-devservices-cli/cmd/eds@latest
# or
make build # ./bin/eds
make build-all # cross-compile darwin/linux/windows × amd64/arm64 into ./dist/
# or, with GoReleaser (https://goreleaser.com)
make goreleaser-build # snapshot build into ./dist/
```

> Target platforms: **Linux + macOS + Windows** (developers locally + CI).
> Override the matrix if you ever need to: `make build-all OSES="linux darwin windows" ARCHS="amd64 arm64"`.
> Override the matrix if you ever need to: `make build-all OSES="linux darwin" ARCHS="amd64 arm64"`.

## Configuration

Expand Down Expand Up @@ -264,6 +266,8 @@ ambient SSH setup the environment provides.
Releases are published on
[GitHub Releases](https://github.com/cloud-ru/evolution-devservices-cli/releases).

### Manual release (Makefile)

```bash
# cross-compile everything into ./dist/ + sha256 checksums
make release
Expand All @@ -273,6 +277,31 @@ git tag v0.2.0 && git push origin v0.2.0
gh release create v0.2.0 dist/* --generate-notes
```

### GoReleaser release (recommended)

This project includes a [GoReleaser](https://goreleaser.com) configuration
(`.goreleaser.yaml`) that mirrors the Makefile build matrix and produces the
same artifacts:

```bash
# Local snapshot build (no tag required, produces ./dist/)
make goreleaser-build

# Full release — requires a git tag; builds, checksums, and uploads to GitHub
# (draft release; publish manually or enable auto-publish in .goreleaser.yaml)
git tag v0.2.0 && git push origin v0.2.0
make goreleaser-release
```

GoReleaser requires the `goreleaser` CLI to be installed:

```bash
# macOS / Linux
brew install goreleaser
# or via Go
go install github.com/goreleaser/goreleaser/v2@latest
```

`scripts/install.sh` downloads from the latest GitHub Release by default.
The `Makefile` also has `make upload`/`make upload-latest` targets for
optionally mirroring builds to an S3-compatible bucket (e.g. for internal
Expand Down Expand Up @@ -300,6 +329,7 @@ make lint
make test # go test ./...
make build # current platform into ./bin/
make build-all # full matrix into ./dist/
make goreleaser-build # snapshot build via GoReleaser into ./dist/
make clean # remove ./bin and ./dist
make help # list targets
```
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/cloud-ru/evolution-devservices-cli

go 1.26.6
go 1.27.1

require (
github.com/google/uuid v1.6.0
Expand Down
Loading