Update release workflow and build scripts for version 0.1.1 #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release SecretHound | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build and Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.24' | |
| - name: Get version from tag | |
| id: get_version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | |
| - name: Build for all platforms | |
| run: | | |
| BUILD_DATE=$(date -u '+%Y-%m-%d %H:%M:%S UTC') | |
| GIT_COMMIT=$(git rev-parse --short HEAD) | |
| # Build for Windows | |
| 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/ | |
| # Build for Linux | |
| 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/ | |
| # Build for macOS | |
| 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/ | |
| - name: Create Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| name: SecretHound v${{ env.VERSION }} | |
| draft: false | |
| prerelease: false | |
| files: | | |
| secrethound-${{ env.VERSION }}-windows-amd64.exe | |
| secrethound-${{ env.VERSION }}-linux-amd64 | |
| secrethound-${{ env.VERSION }}-darwin-amd64 | |
| body: | | |
| # SecretHound v${{ env.VERSION }} | |
| ## Improvements | |
| - Removed global execution timeout allowing scans to run without time constraints | |
| - Enhanced error logging with better visibility for critical errors | |
| - Improved log output reducing redundant messages and clarifying statistics | |
| - Fixed build information display in version command | |
| - Added proper build date and git commit tracking | |
| - Optimized progress display with cleaner output | |
| ## Bug Fixes | |
| - Fixed issue with timeout prematurely ending large scans | |
| - Resolved silent errors in verbose mode | |
| ## Installation | |
| Download the appropriate binary for your platform and make it executable. | |
| For Linux/macOS: | |
| ``` | |
| chmod +x secrethound-${{ env.VERSION }}-linux-amd64 | |
| ./secrethound-${{ env.VERSION }}-linux-amd64 | |
| ``` | |
| For Go users: | |
| ``` | |
| go install github.com/rafabd1/SecretHound/cmd/secrethound@latest | |
| ``` | |
| ## Documentation | |
| See the [documentation](https://github.com/rafabd1/SecretHound/tree/main/docs) for details on usage. |