Skip to content

Commit d1ceee5

Browse files
committed
Update release workflow and build scripts for version 0.1.1
- Improved version command output with build date and git commit - Enhanced build process for all platforms with proper ldflags - Updated release creation step to include detailed changelog - Added changelog file for version history - Updated README to include link to changelog
1 parent eb867a6 commit d1ceee5

File tree

5 files changed

+126
-51
lines changed

5 files changed

+126
-51
lines changed

.github/workflows/release.yml

Lines changed: 50 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
steps:
1717
- name: Checkout code
1818
uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
1921

2022
- name: Set up Go
2123
uses: actions/setup-go@v4
@@ -24,42 +26,65 @@ jobs:
2426

2527
- name: Get version from tag
2628
id: get_version
27-
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
29+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
2830

2931
- name: Build for all platforms
3032
run: |
31-
# Create build directories
32-
mkdir -p dist
33+
BUILD_DATE=$(date -u '+%Y-%m-%d %H:%M:%S UTC')
34+
GIT_COMMIT=$(git rev-parse --short HEAD)
3335
34-
# Set build flags
35-
BUILD_FLAGS="-s -w -X github.com/rafabd1/SecretHound/cmd.Version=${VERSION} -X github.com/rafabd1/SecretHound/cmd.BuildDate=$(date -u +%Y-%m-%d) -X github.com/rafabd1/SecretHound/cmd.GitCommit=${GITHUB_SHA}"
36+
# Build for Windows
37+
GOOS=windows GOARCH=amd64 go build -ldflags "-X github.com/rafabd1/SecretHound/cmd.Version=${{ env.VERSION }} -X 'github.com/rafabd1/SecretHound/cmd.BuildDate=${BUILD_DATE}' -X github.com/rafabd1/SecretHound/cmd.GitCommit=${GIT_COMMIT}" -o secrethound-${{ env.VERSION }}-windows-amd64.exe ./cmd/secrethound/
3638
3739
# Build for Linux
38-
GOOS=linux GOARCH=amd64 go build -ldflags="${BUILD_FLAGS}" -o dist/secrethound-linux-amd64 ./cmd/secrethound
39-
40-
# Build for Windows
41-
GOOS=windows GOARCH=amd64 go build -ldflags="${BUILD_FLAGS}" -o dist/secrethound-windows-amd64.exe ./cmd/secrethound
40+
GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/rafabd1/SecretHound/cmd.Version=${{ env.VERSION }} -X 'github.com/rafabd1/SecretHound/cmd.BuildDate=${BUILD_DATE}' -X github.com/rafabd1/SecretHound/cmd.GitCommit=${GIT_COMMIT}" -o secrethound-${{ env.VERSION }}-linux-amd64 ./cmd/secrethound/
4241
4342
# Build for macOS
44-
GOOS=darwin GOARCH=amd64 go build -ldflags="${BUILD_FLAGS}" -o dist/secrethound-darwin-amd64 ./cmd/secrethound
45-
46-
# Create checksums
47-
cd dist
48-
sha256sum secrethound-linux-amd64 secrethound-windows-amd64.exe secrethound-darwin-amd64 > checksums.txt
49-
cd ..
50-
43+
GOOS=darwin GOARCH=amd64 go build -ldflags "-X github.com/rafabd1/SecretHound/cmd.Version=${{ env.VERSION }} -X 'github.com/rafabd1/SecretHound/cmd.BuildDate=${BUILD_DATE}' -X github.com/rafabd1/SecretHound/cmd.GitCommit=${GIT_COMMIT}" -o secrethound-${{ env.VERSION }}-darwin-amd64 ./cmd/secrethound/
44+
5145
- name: Create Release
5246
id: create_release
5347
uses: softprops/action-gh-release@v1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5450
with:
55-
files: |
56-
dist/secrethound-linux-amd64
57-
dist/secrethound-windows-amd64.exe
58-
dist/secrethound-darwin-amd64
59-
dist/checksums.txt
60-
name: SecretHound ${{ env.VERSION }}
51+
name: SecretHound v${{ env.VERSION }}
6152
draft: false
6253
prerelease: false
63-
generate_release_notes: true
64-
env:
65-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
files: |
55+
secrethound-${{ env.VERSION }}-windows-amd64.exe
56+
secrethound-${{ env.VERSION }}-linux-amd64
57+
secrethound-${{ env.VERSION }}-darwin-amd64
58+
body: |
59+
# SecretHound v${{ env.VERSION }}
60+
61+
## Improvements
62+
- Removed global execution timeout allowing scans to run without time constraints
63+
- Enhanced error logging with better visibility for critical errors
64+
- Improved log output reducing redundant messages and clarifying statistics
65+
- Fixed build information display in version command
66+
- Added proper build date and git commit tracking
67+
- Optimized progress display with cleaner output
68+
69+
## Bug Fixes
70+
- Fixed issue with timeout prematurely ending large scans
71+
- Resolved silent errors in verbose mode
72+
73+
## Installation
74+
75+
Download the appropriate binary for your platform and make it executable.
76+
77+
For Linux/macOS:
78+
```
79+
chmod +x secrethound-${{ env.VERSION }}-linux-amd64
80+
./secrethound-${{ env.VERSION }}-linux-amd64
81+
```
82+
83+
For Go users:
84+
```
85+
go install github.com/rafabd1/SecretHound/cmd/secrethound@latest
86+
```
87+
88+
## Documentation
89+
90+
See the [documentation](https://github.com/rafabd1/SecretHound/tree/main/docs) for details on usage.

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# SecretHound Changelog
2+
3+
## v0.1.1 (2024-07-05)
4+
5+
### Improvements
6+
- Removed global execution timeout allowing scans to run without time constraints
7+
- Enhanced error logging with better visibility for critical errors
8+
- Improved log output reducing redundant messages and clarifying statistics
9+
- Fixed build information display in version command
10+
- Added proper build date and git commit tracking
11+
12+
### Bug Fixes
13+
- Fixed issue with timeout prematurely ending large scans
14+
- Resolved silent errors in verbose mode
15+
- Enhanced terminal output coordination for cleaner display
16+
17+
### Technical Changes
18+
- Added build script with proper ldflags for version information
19+
- Improved GitHub Actions workflow for releases
20+
- Updated documentation for clarity and completeness
21+
22+
## v0.1.0 (2024-06-15)
23+
24+
### Core Features
25+
- Multi-threaded scanning of remote URLs and local files
26+
- 50+ built-in regex patterns to detect common API keys and secrets
27+
- Smart request scheduling with domain-aware rate limiting
28+
- Detection and handling of WAF blocks and rate limits
29+
- Real-time progress bar with detailed statistics
30+
- Structured output with context for each discovered secret
31+
32+
### Technical Highlights
33+
- Concurrent processing architecture for maximum performance
34+
- Configurable timeout and retry mechanisms
35+
- Customizable regex patterns via external file
36+
- Cross-platform support (Windows, macOS, and Linux)
37+
38+
### Getting Started
39+
Download the appropriate binary for your platform or install via:
40+
```bash
41+
go install github.com/rafabd1/SecretHound/cmd/secrethound@latest
42+
```
43+
44+
Check the README for detailed usage instructions and examples.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ For more detailed information, see the [documentation directory](docs/):
118118
- [Usage Examples](docs/USAGE.md) - Detailed usage examples
119119
- [Technical Details](docs/TECHNICAL.md) - Internal architecture and design
120120
- [Supported Secrets](docs/SUPPORTED_SECRETS.md) - List of secret types detected
121+
- [Changelog](CHANGELOG.md) - Check the latest updates and version history
121122

122123
## Contributing
123124

build.sh

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
11
#!/bin/bash
22

33
# Build script for SecretHound
4+
VERSION="0.1.1"
5+
BUILD_DATE=$(date -u '+%Y-%m-%d %H:%M:%S UTC')
6+
GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown")
47

5-
VERSION=$(grep -oP 'Version = "\K[^"]+' cmd/version.go)
6-
echo "Building SecretHound v$VERSION..."
7-
8-
# Create build directory
9-
mkdir -p bin
8+
# Display build info
9+
echo "Building SecretHound $VERSION"
10+
echo "Build Date: $BUILD_DATE"
11+
echo "Git Commit: $GIT_COMMIT"
1012

1113
# Build for current platform
12-
echo "Building for current platform..."
13-
go build -o bin/secrethound ./cmd/secrethound
14+
echo "Building for $(go env GOOS)/$(go env GOARCH)..."
15+
go build -ldflags "-X github.com/rafabd1/SecretHound/cmd.Version=$VERSION -X 'github.com/rafabd1/SecretHound/cmd.BuildDate=$BUILD_DATE' -X github.com/rafabd1/SecretHound/cmd.GitCommit=$GIT_COMMIT" -o secrethound ./cmd/secrethound/
16+
17+
echo "Build complete: $(pwd)/secrethound"
1418

15-
# Cross-compile for other platforms (optional)
19+
# Build for all major platforms
1620
if [ "$1" == "release" ]; then
17-
echo "Building release binaries..."
21+
echo "Building release binaries for all platforms..."
22+
23+
# Create output directory
24+
mkdir -p release
1825

19-
# Linux (64-bit)
20-
GOOS=linux GOARCH=amd64 go build -o bin/secrethound-linux-amd64 ./cmd/secrethound
26+
# Build for Windows
27+
GOOS=windows GOARCH=amd64 go build -ldflags "-X github.com/rafabd1/SecretHound/cmd.Version=$VERSION -X 'github.com/rafabd1/SecretHound/cmd.BuildDate=$BUILD_DATE' -X github.com/rafabd1/SecretHound/cmd.GitCommit=$GIT_COMMIT" -o release/secrethound-$VERSION-windows-amd64.exe ./cmd/secrethound/
2128

22-
# Windows (64-bit)
23-
GOOS=windows GOARCH=amd64 go build -o bin/secrethound-windows-amd64.exe ./cmd/secrethound
29+
# Build for Linux
30+
GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/rafabd1/SecretHound/cmd.Version=$VERSION -X 'github.com/rafabd1/SecretHound/cmd.BuildDate=$BUILD_DATE' -X github.com/rafabd1/SecretHound/cmd.GitCommit=$GIT_COMMIT" -o release/secrethound-$VERSION-linux-amd64 ./cmd/secrethound/
2431

25-
# macOS (64-bit)
26-
GOOS=darwin GOARCH=amd64 go build -o bin/secrethound-darwin-amd64 ./cmd/secrethound
32+
# Build for macOS
33+
GOOS=darwin GOARCH=amd64 go build -ldflags "-X github.com/rafabd1/SecretHound/cmd.Version=$VERSION -X 'github.com/rafabd1/SecretHound/cmd.BuildDate=$BUILD_DATE' -X github.com/rafabd1/SecretHound/cmd.GitCommit=$GIT_COMMIT" -o release/secrethound-$VERSION-darwin-amd64 ./cmd/secrethound/
2734

28-
echo "Release binaries built in bin/ directory"
29-
else
30-
echo "Built binary in bin/secrethound"
31-
echo "Run 'build.sh release' to build for all platforms."
35+
echo "Release builds complete in $(pwd)/release/"
3236
fi

cmd/version.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,24 @@ import (
88
"github.com/spf13/cobra"
99
)
1010

11+
// Build information
1112
var (
12-
Version = "0.1.0"
13+
Version = "0.1.1"
1314
BuildDate = "undefined"
1415
GitCommit = "undefined"
1516
)
1617

1718
// versionCmd represents the version command
1819
var versionCmd = &cobra.Command{
1920
Use: "version",
20-
Short: "Print the version number of SecretHound",
21-
Long: `Display version information about SecretHound and the system it is running on.`,
22-
Run: func(cmd *cobra.Command, args []string) {
23-
bold := color.New(color.Bold).SprintFunc()
21+
Short: "Print version information",
22+
Long: `Display build, version, and runtime information about SecretHound.`,
23+
Run: func(cmd *cobra.Command, args []string) {
24+
// Print version information with colored output
2425
cyan := color.New(color.FgCyan).SprintFunc()
2526
green := color.New(color.FgGreen).SprintFunc()
2627

27-
fmt.Println(bold("SecretHound Version Information"))
28+
fmt.Println(cyan("SecretHound Version Information"))
2829
fmt.Printf("%s: %s\n", cyan("Version"), green(Version))
2930
fmt.Printf("%s: %s\n", cyan("Build Date"), green(BuildDate))
3031
fmt.Printf("%s: %s\n", cyan("Git Commit"), green(GitCommit))
@@ -35,4 +36,4 @@ var versionCmd = &cobra.Command{
3536

3637
func init() {
3738
rootCmd.AddCommand(versionCmd)
38-
}
39+
}

0 commit comments

Comments
 (0)