diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..79f3f1b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-go@v6 + with: + go-version-file: go.mod + + - run: go test -race -count=1 ./... + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-go@v6 + with: + go-version-file: go.mod + + - uses: golangci/golangci-lint-action@v9 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5281de4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: Release + +on: + push: + tags: ["v*"] + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - uses: actions/setup-go@v6 + with: + go-version-file: go.mod + + - uses: goreleaser/goreleaser-action@v7 + with: + version: "~> v2" + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index cc1ca7d..16b74ba 100644 --- a/.gitignore +++ b/.gitignore @@ -21,5 +21,8 @@ profile.cov go.work go.work.sum +# GoReleaser +dist/ + # env file .env diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..1dc2b56 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,20 @@ +version: 2 + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + goarch: + - amd64 + - arm64 + +archives: + - format_overrides: + - goos: windows + format: zip + +changelog: + use: github-native diff --git a/README.md b/README.md index feb84cb..3b79f85 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,11 @@ fuzzing runs. `gofuzzmin` fixes this. ## Install +Pre-built binaries for Linux, macOS, and Windows are available on the +[releases page](https://github.com/die-net/gofuzzmin/releases). + +Or install from source: + ``` go install github.com/die-net/gofuzzmin@latest ``` @@ -83,6 +88,20 @@ matters because Go's `-coverprofile` measures a different, coarser signal Only the build cache corpus is touched. Seeds in `testdata/fuzz/` are never deleted — they serve as regression tests. +## Development + +Run tests (use `-short` to skip the integration test): + +``` +go test ./... +``` + +Run the linter ([golangci-lint v2](https://golangci-lint.run/)): + +``` +golangci-lint run . +``` + ## License BSD 3-Clause. See [LICENSE](LICENSE). diff --git a/go.mod b/go.mod index db0fdc4..0e00859 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/die-net/gofuzzmin -go 1.26.1 +go 1.25