Skip to content

Commit 0646dc2

Browse files
authored
Merge pull request #18 from shubham-stepsecurity/sm/feat/migrate
chore(mdm): update release process & resolve minor issues
2 parents 5d93c7c + 3cbd1f0 commit 0646dc2

12 files changed

Lines changed: 138 additions & 154 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ permissions: {}
77

88
jobs:
99
release:
10-
name: Build, Sign & Release
10+
name: Build & Draft Release
1111
runs-on: ubuntu-latest
1212
permissions:
13-
contents: write # create tag, release, and upload assets
14-
id-token: write # OIDC token for cosign keyless signing and build provenance
15-
attestations: write # SLSA build provenance
13+
contents: write
14+
id-token: write
15+
attestations: write
1616

1717
steps:
1818
- name: Harden the runner (Audit all outbound calls)
@@ -36,12 +36,11 @@ jobs:
3636
tag="v${version}"
3737
echo "version=${version}" >> "$GITHUB_OUTPUT"
3838
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
39-
echo "Detected version: ${version} (tag: ${tag})"
4039
4140
- name: Check tag does not already exist
4241
run: |
4342
if git rev-parse "refs/tags/${{ steps.version.outputs.tag }}" >/dev/null 2>&1; then
44-
echo "::error::Tag ${{ steps.version.outputs.tag }} already exists. Bump Version in internal/buildinfo/version.go before releasing."
43+
echo "::error::Tag ${{ steps.version.outputs.tag }} already exists."
4544
exit 1
4645
fi
4746
@@ -69,70 +68,36 @@ jobs:
6968
- name: Install cosign
7069
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
7170

72-
- name: Prepare release artifacts for signing
71+
- name: Locate binary
72+
id: binary
7373
run: |
74-
# Copy binaries to match the exact names users download from the release.
75-
# GoReleaser uploads as name_template (e.g. stepsecurity-dev-machine-guard_darwin_amd64)
76-
# but keeps them in build subdirs locally. We copy to dist/ with release names
77-
# so cosign signs the same bytes users verify against.
78-
AMD64_SRC=$(find dist -type f -name 'stepsecurity-dev-machine-guard' -path '*darwin_amd64*' | head -1)
79-
ARM64_SRC=$(find dist -type f -name 'stepsecurity-dev-machine-guard' -path '*darwin_arm64*' | head -1)
80-
81-
for label in "amd64:${AMD64_SRC}" "arm64:${ARM64_SRC}"; do
82-
name="${label%%:*}"
83-
path="${label#*:}"
84-
if [ -z "$path" ] || [ ! -f "$path" ]; then
85-
echo "::error::Binary not found for ${name}"
86-
find dist -type f
87-
exit 1
88-
fi
89-
done
90-
91-
cp "$AMD64_SRC" dist/stepsecurity-dev-machine-guard_darwin_amd64
92-
cp "$ARM64_SRC" dist/stepsecurity-dev-machine-guard_darwin_arm64
93-
echo "Prepared release artifacts for signing"
74+
BINARY=$(find dist -type f -name '*darwin_unnotarized' | head -1)
75+
if [ -z "$BINARY" ] || [ ! -f "$BINARY" ]; then
76+
echo "::error::Binary not found"
77+
find dist -type f
78+
exit 1
79+
fi
80+
echo "path=$BINARY" >> "$GITHUB_OUTPUT"
9481
95-
- name: Sign artifacts with Sigstore (keyless)
82+
- name: Sign artifacts with Sigstore
9683
run: |
97-
cosign sign-blob dist/stepsecurity-dev-machine-guard_darwin_amd64 \
98-
--bundle dist/stepsecurity-dev-machine-guard_darwin_amd64.bundle --yes
99-
cosign sign-blob dist/stepsecurity-dev-machine-guard_darwin_arm64 \
100-
--bundle dist/stepsecurity-dev-machine-guard_darwin_arm64.bundle --yes
84+
cosign sign-blob "${{ steps.binary.outputs.path }}" \
85+
--bundle "${{ steps.binary.outputs.path }}.bundle" --yes
10186
cosign sign-blob stepsecurity-dev-machine-guard.sh \
10287
--bundle dist/stepsecurity-dev-machine-guard.sh.bundle --yes
10388
104-
- name: Generate checksums
105-
run: |
106-
# Separate checksum file for cosign-signed artifacts (script + bundles).
107-
# GoReleaser already generates checksums for the Go binaries in its own SHA256SUMS file.
108-
sha256sum dist/stepsecurity-dev-machine-guard_darwin_amd64 > dist/cosign-checksums.txt
109-
sha256sum dist/stepsecurity-dev-machine-guard_darwin_arm64 >> dist/cosign-checksums.txt
110-
sha256sum stepsecurity-dev-machine-guard.sh >> dist/cosign-checksums.txt
111-
112-
- name: Upload signature bundles and checksums to release
89+
- name: Upload cosign bundles
11390
env:
11491
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11592
run: |
11693
gh release upload "${{ steps.version.outputs.tag }}" \
117-
dist/stepsecurity-dev-machine-guard_darwin_amd64.bundle \
118-
dist/stepsecurity-dev-machine-guard_darwin_arm64.bundle \
94+
"${{ steps.binary.outputs.path }}.bundle" \
11995
dist/stepsecurity-dev-machine-guard.sh.bundle \
120-
dist/cosign-checksums.txt \
12196
--clobber
12297
123-
- name: Mark release as immutable (not a draft, not a prerelease)
124-
env:
125-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
126-
run: |
127-
gh release edit "${{ steps.version.outputs.tag }}" \
128-
--draft=false \
129-
--prerelease=false \
130-
--latest
131-
13298
- name: Attest build provenance
13399
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
134100
with:
135101
subject-path: |
136-
dist/stepsecurity-dev-machine-guard_darwin_amd64
137-
dist/stepsecurity-dev-machine-guard_darwin_arm64
102+
${{ steps.binary.outputs.path }}
138103
stepsecurity-dev-machine-guard.sh

.goreleaser.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,21 @@ builds:
2121
env:
2222
- CGO_ENABLED=0
2323

24-
archives:
25-
- format: binary
26-
name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}"
24+
universal_binaries:
25+
- id: universal
26+
ids:
27+
- stepsecurity-dev-machine-guard
28+
replace: true
29+
name_template: "stepsecurity-dev-machine-guard-{{ .Version }}-darwin_unnotarized"
2730

28-
checksum:
29-
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
30-
algorithm: sha256
31+
archives:
32+
- ids:
33+
- universal
34+
formats:
35+
- binary
36+
name_template: "stepsecurity-dev-machine-guard-{{ .Version }}-darwin_unnotarized"
3137

3238
release:
39+
draft: true
3340
extra_files:
3441
- glob: stepsecurity-dev-machine-guard.sh

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
See [VERSIONING.md](VERSIONING.md) for why the version starts at 1.8.1.
99

10+
## [1.9.1] - 2026-04-07
11+
12+
### Fixed
13+
14+
- Config `quiet: false` now correctly shows progress (was ignored previously).
15+
- Enterprise auto-detect mode respects the configured quiet setting instead of overriding it.
16+
- Release now produces a single universal macOS binary (amd64 + arm64).
17+
1018
## [1.9.0] - 2026-04-03
1119

1220
Migrated from shell script to a compiled Go binary. All existing scanning features, detection logic, CLI flags, output formats, and enterprise telemetry are preserved — this release changes the implementation, not the functionality.
1321

1422
### Added
23+
1524
- **Go binary**: Single compiled binary (`stepsecurity-dev-machine-guard`) replaces the shell script. Zero external dependencies, no runtime required.
1625
- **`configure` / `configure show` commands**: Interactive setup and display of enterprise credentials, search directories, and preferences. Saved to `~/.stepsecurity/config.json`.
1726

1827
## [1.8.2] - 2026-03-17
1928

2029
### Added
30+
2131
- `--search-dirs DIR [DIR...]` flag to scan specific directories instead of `$HOME` (replaces default; repeatable)
2232
- Accepts multiple directories in a single flag: `--search-dirs /tmp /opt /var`
2333
- Supports repeated use: `--search-dirs /tmp --search-dirs /opt`
@@ -28,6 +38,7 @@ Migrated from shell script to a compiled Go binary. All existing scanning featur
2838
First open-source release. The scanning engine was previously an internal enterprise tool (v1.0.0-v1.8.1) running in production. This release adds community mode for local-only scanning while keeping the enterprise codebase intact.
2939

3040
### Added
41+
3142
- **Community mode** with three output formats: pretty terminal, JSON, and HTML report
3243
- **AI agent and CLI tool detection**: Claude Code, Codex, Gemini CLI, Kiro, Aider, OpenCode, and more
3344
- **General-purpose AI agent detection**: OpenClaw, ClawdBot, GPT-Engineer, Claude Cowork
@@ -41,17 +52,20 @@ First open-source release. The scanning engine was previously an internal enterp
4152
- ShellCheck CI workflow with Harden-Runner
4253

4354
### Changed
55+
4456
- Enterprise config variables are now clearly labeled and placed below the community-facing header
4557
- Progress messages suppressed by default in community mode (enable with `--verbose`)
4658
- Node.js scanning off by default in community mode (enable with `--enable-npm-scan`)
4759

4860
### Enterprise (unchanged from v1.8.1)
61+
4962
- `install`, `uninstall`, and `send-telemetry` commands
5063
- Launchd scheduling (LaunchDaemon for root, LaunchAgent for user)
5164
- S3 presigned URL upload with backend notification
5265
- Execution log capture and base64 encoding
5366
- Instance locking to prevent concurrent runs
5467

68+
[1.9.1]: https://github.com/step-security/dev-machine-guard/compare/v1.9.0...v1.9.1
5569
[1.9.0]: https://github.com/step-security/dev-machine-guard/compare/v1.8.2...v1.9.0
5670
[1.8.2]: https://github.com/step-security/dev-machine-guard/compare/v1.8.1...v1.8.2
5771
[1.8.1]: https://github.com/step-security/dev-machine-guard/releases/tag/v1.8.1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<a href="https://github.com/step-security/dev-machine-guard/actions/workflows/go.yml"><img src="https://github.com/step-security/dev-machine-guard/actions/workflows/go.yml/badge.svg" alt="Go CI"></a>
1313
<a href="https://github.com/step-security/dev-machine-guard/actions/workflows/shellcheck.yml"><img src="https://github.com/step-security/dev-machine-guard/actions/workflows/shellcheck.yml/badge.svg" alt="ShellCheck CI"></a>
1414
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="License: Apache 2.0"></a>
15-
<a href="https://github.com/step-security/dev-machine-guard/releases"><img src="https://img.shields.io/badge/version-1.9.0-purple.svg" alt="Version 1.9.0"></a>
15+
<a href="https://github.com/step-security/dev-machine-guard/releases"><img src="https://img.shields.io/badge/version-1.9.1-purple.svg" alt="Version 1.9.1"></a>
1616
</p>
1717

1818
<p align="center">

cmd/stepsecurity-dev-machine-guard/main.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,27 @@ func main() {
3737
}
3838
if !cfg.OutputFormatSet && config.OutputFormat != "" {
3939
cfg.OutputFormat = config.OutputFormat
40-
cfg.OutputFormatSet = true // treat saved format as explicitly set
40+
// Note: do NOT set OutputFormatSet here — saved config is a default preference,
41+
// not an explicit CLI flag. Enterprise auto-detection should still work
42+
// when no CLI flags are passed.
4143
if config.OutputFormat == "html" && cfg.HTMLOutputFile == "" && config.HTMLOutputFile != "" {
4244
cfg.HTMLOutputFile = config.HTMLOutputFile
4345
}
4446
}
4547

4648
exec := executor.NewReal()
47-
quiet := !cfg.Verbose
48-
// Apply saved quiet preference
49-
if config.Quiet != nil && *config.Quiet {
50-
quiet = true
49+
50+
// Quiet resolution: config is the base, CLI overrides.
51+
quiet := true
52+
if config.Quiet != nil {
53+
quiet = *config.Quiet
5154
}
52-
// --verbose always overrides quiet config
5355
if cfg.Verbose {
5456
quiet = false
5557
}
5658
if cfg.OutputFormat == "json" {
5759
quiet = true
5860
}
59-
// Enterprise commands (send-telemetry, install) always show progress
6061
if cfg.Command == "send-telemetry" || cfg.Command == "install" {
6162
quiet = false
6263
}

0 commit comments

Comments
 (0)