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
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [main]
pull_request:
branches: [main]
workflow_call:

jobs:
ci:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [main]
pull_request:
branches: [main]
workflow_call:

jobs:
lint:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release

on:
workflow_call:

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/tag-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Tag Release

on:
push:
tags:
- "v*"

jobs:
ci:
uses: ./.github/workflows/ci.yaml

lint:
uses: ./.github/workflows/lint.yaml

release:
needs: [ci, lint]
uses: ./.github/workflows/release.yaml
40 changes: 40 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: 2

builds:
- main: ./cmd/dcm
binary: dcm
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
ldflags:
- -s -w
- -X github.com/dcm-project/cli/internal/version.Version={{.Version}}
- -X github.com/dcm-project/cli/internal/version.Commit={{.Commit}}
- -X github.com/dcm-project/cli/internal/version.BuildTime={{.Date}}

archives:
- format: tar.gz
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
files:
- LICENSE
format_overrides:
- goos: windows
format: zip

checksum:
name_template: "checksums.txt"

changelog:
use: github
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^ci:"
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,12 @@ dcm-cli/
│ └── e2e_suite_test.go
├── .github/
│ └── workflows/
│ └── ci.yaml
│ ├── ci.yaml
│ ├── lint.yaml
│ ├── check-clean-commits.yaml
│ ├── release.yaml
│ └── tag-release.yaml
├── .goreleaser.yaml
├── CLAUDE.md
├── Containerfile
├── go.mod
Expand Down Expand Up @@ -918,7 +923,23 @@ build:
go build -ldflags "$(LDFLAGS)" -o bin/dcm ./cmd/dcm
```

### 10.3 Containerfile
### 10.3 Release

Releases are automated via GoReleaser and GitHub Actions. When a `v*` tag is pushed, the `tag-release` workflow runs CI tests and linting, then triggers the `release` workflow which uses GoReleaser to:

- Build `dcm` binaries for linux, darwin, and windows (amd64 and arm64)
- Inject version, commit, and build time via ldflags
- Create a GitHub release with archives and checksums
- Include the LICENSE in each archive

To create a release:

```bash
git tag v0.1.0
git push origin v0.1.0
```

### 10.4 Containerfile

Multi-stage UBI9 build matching other DCM services:

Expand All @@ -938,15 +959,15 @@ USER 1001
ENTRYPOINT ["dcm"]
```

### 10.4 Go Module
### 10.5 Go Module

```
module github.com/dcm-project/dcm-cli

go 1.25.5
```

### 10.5 Dependencies
### 10.6 Dependencies

| Dependency | Purpose |
|------------|---------|
Expand All @@ -958,7 +979,7 @@ go 1.25.5
| `github.com/onsi/ginkgo/v2` | Test framework (test dependency) |
| `github.com/onsi/gomega` | Test matchers (test dependency) |

### 10.6 tools.go
### 10.7 tools.go

```go
//go:build tools
Expand Down