Skip to content

Commit 6259b62

Browse files
chore(windows): resolve conflicts
Signed-off-by: Swarit Pandey <swarit@stepsecurity.io>
2 parents ca351db + 0646dc2 commit 6259b62

12 files changed

Lines changed: 156 additions & 159 deletions

File tree

.github/workflows/release.yml

Lines changed: 31 additions & 60 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,81 +68,53 @@ 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 binaries
72+
id: binaries
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-
79-
declare -A ARTIFACTS=(
80-
["darwin_amd64"]="stepsecurity-dev-machine-guard"
81-
["darwin_arm64"]="stepsecurity-dev-machine-guard"
82-
["windows_amd64"]="stepsecurity-dev-machine-guard.exe"
83-
["windows_arm64"]="stepsecurity-dev-machine-guard.exe"
84-
)
85-
86-
for target in "${!ARTIFACTS[@]}"; do
87-
binary="${ARTIFACTS[$target]}"
88-
src=$(find dist -type f -name "$binary" -path "*${target}*" | head -1)
89-
if [ -z "$src" ] || [ ! -f "$src" ]; then
90-
echo "::error::Binary not found for ${target}"
74+
DARWIN=$(find dist -type f -name '*darwin_unnotarized' | head -1)
75+
WIN_AMD64=$(find dist -type f -name '*windows_amd64.exe' | head -1)
76+
WIN_ARM64=$(find dist -type f -name '*windows_arm64.exe' | head -1)
77+
78+
for label in "darwin:${DARWIN}" "windows_amd64:${WIN_AMD64}" "windows_arm64:${WIN_ARM64}"; do
79+
name="${label%%:*}"
80+
path="${label#*:}"
81+
if [ -z "$path" ] || [ ! -f "$path" ]; then
82+
echo "::error::Binary not found for ${name}"
9183
find dist -type f
9284
exit 1
9385
fi
94-
cp "$src" "dist/stepsecurity-dev-machine-guard_${target}${binary##stepsecurity-dev-machine-guard}"
9586
done
96-
echo "Prepared release artifacts for signing"
9787
98-
- name: Sign artifacts with Sigstore (keyless)
88+
echo "darwin=$DARWIN" >> "$GITHUB_OUTPUT"
89+
echo "win_amd64=$WIN_AMD64" >> "$GITHUB_OUTPUT"
90+
echo "win_arm64=$WIN_ARM64" >> "$GITHUB_OUTPUT"
91+
92+
- name: Sign artifacts with Sigstore
9993
run: |
10094
for artifact in \
101-
dist/stepsecurity-dev-machine-guard_darwin_amd64 \
102-
dist/stepsecurity-dev-machine-guard_darwin_arm64 \
103-
dist/stepsecurity-dev-machine-guard_windows_amd64.exe \
104-
dist/stepsecurity-dev-machine-guard_windows_arm64.exe \
95+
"${{ steps.binaries.outputs.darwin }}" \
96+
"${{ steps.binaries.outputs.win_amd64 }}" \
97+
"${{ steps.binaries.outputs.win_arm64 }}" \
10598
stepsecurity-dev-machine-guard.sh; do
10699
cosign sign-blob "$artifact" --bundle "${artifact}.bundle" --yes
107100
done
108101
109-
- name: Generate checksums
110-
run: |
111-
sha256sum \
112-
dist/stepsecurity-dev-machine-guard_darwin_amd64 \
113-
dist/stepsecurity-dev-machine-guard_darwin_arm64 \
114-
dist/stepsecurity-dev-machine-guard_windows_amd64.exe \
115-
dist/stepsecurity-dev-machine-guard_windows_arm64.exe \
116-
stepsecurity-dev-machine-guard.sh \
117-
> dist/cosign-checksums.txt
118-
119-
- name: Upload signature bundles and checksums to release
102+
- name: Upload cosign bundles
120103
env:
121104
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122105
run: |
123106
gh release upload "${{ steps.version.outputs.tag }}" \
124-
dist/stepsecurity-dev-machine-guard_darwin_amd64.bundle \
125-
dist/stepsecurity-dev-machine-guard_darwin_arm64.bundle \
126-
dist/stepsecurity-dev-machine-guard_windows_amd64.exe.bundle \
127-
dist/stepsecurity-dev-machine-guard_windows_arm64.exe.bundle \
107+
"${{ steps.binaries.outputs.darwin }}.bundle" \
108+
"${{ steps.binaries.outputs.win_amd64 }}.bundle" \
109+
"${{ steps.binaries.outputs.win_arm64 }}.bundle" \
128110
dist/stepsecurity-dev-machine-guard.sh.bundle \
129-
dist/cosign-checksums.txt \
130111
--clobber
131112
132-
- name: Mark release as immutable (not a draft, not a prerelease)
133-
env:
134-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
135-
run: |
136-
gh release edit "${{ steps.version.outputs.tag }}" \
137-
--draft=false \
138-
--prerelease=false \
139-
--latest
140-
141113
- name: Attest build provenance
142114
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
143115
with:
144116
subject-path: |
145-
dist/stepsecurity-dev-machine-guard_darwin_amd64
146-
dist/stepsecurity-dev-machine-guard_darwin_arm64
147-
dist/stepsecurity-dev-machine-guard_windows_amd64.exe
148-
dist/stepsecurity-dev-machine-guard_windows_arm64.exe
117+
${{ steps.binaries.outputs.darwin }}
118+
${{ steps.binaries.outputs.win_amd64 }}
119+
${{ steps.binaries.outputs.win_arm64 }}
149120
stepsecurity-dev-machine-guard.sh

.goreleaser.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,28 @@ builds:
2222
env:
2323
- CGO_ENABLED=0
2424

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

29-
checksum:
30-
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
31-
algorithm: sha256
32+
archives:
33+
- id: darwin
34+
ids:
35+
- universal
36+
formats:
37+
- binary
38+
name_template: "stepsecurity-dev-machine-guard-{{ .Version }}-darwin_unnotarized"
39+
- id: windows
40+
ids:
41+
- stepsecurity-dev-machine-guard
42+
formats:
43+
- binary
44+
name_template: "stepsecurity-dev-machine-guard-{{ .Version }}-windows_{{ .Arch }}"
3245

3346
release:
47+
draft: true
3448
extra_files:
3549
- 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
@@ -39,26 +39,27 @@ func main() {
3939
}
4040
if !cfg.OutputFormatSet && config.OutputFormat != "" {
4141
cfg.OutputFormat = config.OutputFormat
42-
cfg.OutputFormatSet = true // treat saved format as explicitly set
42+
// Note: do NOT set OutputFormatSet here — saved config is a default preference,
43+
// not an explicit CLI flag. Enterprise auto-detection should still work
44+
// when no CLI flags are passed.
4345
if config.OutputFormat == "html" && cfg.HTMLOutputFile == "" && config.HTMLOutputFile != "" {
4446
cfg.HTMLOutputFile = config.HTMLOutputFile
4547
}
4648
}
4749

4850
exec := executor.NewReal()
49-
quiet := !cfg.Verbose
50-
// Apply saved quiet preference
51-
if config.Quiet != nil && *config.Quiet {
52-
quiet = true
51+
52+
// Quiet resolution: config is the base, CLI overrides.
53+
quiet := true
54+
if config.Quiet != nil {
55+
quiet = *config.Quiet
5356
}
54-
// --verbose always overrides quiet config
5557
if cfg.Verbose {
5658
quiet = false
5759
}
5860
if cfg.OutputFormat == "json" {
5961
quiet = true
6062
}
61-
// Enterprise commands (send-telemetry, install) always show progress
6263
if cfg.Command == "send-telemetry" || cfg.Command == "install" {
6364
quiet = false
6465
}

0 commit comments

Comments
 (0)