diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..dc11e0a --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,29 @@ +name: release + +on: + push: + tags: [ 'v*' ] + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: '1.19' + + - name: Release + uses: goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..01f10f0 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,38 @@ +# Run locally with: goreleaser --rm-dist --snapshot --skip-publish +project_name: modgv +before: + hooks: + - go mod tidy + - go mod download +builds: +- env: + - CGO_ENABLED=0 + ldflags: + - -s -w -X "main.Version={{.Version}}" -X "main.Build={{.ShortCommit}}" + - -a -extldflags "-static" + goos: + - windows + - linux + - darwin + goarch: + #- arm + - arm64 + - amd64 + goarm: + - 7 +archives: + - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + format_overrides: + - goos: windows + format: zip +nfpms: + - + package_name: modgv + vendor: Luca Sepe + homepage: https://github.com/lucasepe/modgv + description: Converts 'go mod graph' output into Graphviz's DOT language. + license: MIT + maintainer: Luca Sepe + formats: + - deb + - rpm diff --git a/README.md b/README.md index a0cc056..dd5ff51 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # modgv -[![Go Report Card](https://goreportcard.com/badge/github.com/lucasepe/modgv)](https://goreportcard.com/report/github.com/lucasepe/modgv)     [![Go Coverage](https://gocover.io/_badge/github.com/lucasepe/modgv?nocache=modgv)](https://gocover.io/_badge/github.com/lucasepe/modgv?nocache=modgv)     [![Go API Reference](https://img.shields.io/badge/go-docs-blue.svg?style=flat)](https://pkg.go.dev/github.com/lucasepe/modgv?tab=doc)     [![Mentioned in Awesome Go](https://awesome.re/mentioned-badge-flat.svg)](https://github.com/avelino/awesome-go#package-management) +[![Go Report Card](https://goreportcard.com/badge/github.com/lucasepe/modgv)](https://goreportcard.com/report/github.com/lucasepe/modgv)     [![Go API Reference](https://img.shields.io/badge/go-docs-blue.svg?style=flat)](https://pkg.go.dev/github.com/lucasepe/modgv?tab=doc)     [![Mentioned in Awesome Go](https://awesome.re/mentioned-badge-flat.svg)](https://github.com/avelino/awesome-go#package-management) Converts 'go mod graph' output into [GraphViz](https://graphviz.gitlab.io/download/)'s DOT language. @@ -20,6 +20,22 @@ For each module: ## Installation +### From [binary releases](https://github.com/lucasepe/modgv/releases) (macOS, Windows, Linux) + +memo currently provides pre-built binaries for the following: + +- macOS (Darwin) +- Windows +- Linux + +1. Download the appropriate version for your platform from [memo releases](https://github.com/lucasepe/modgv/releases). + +2. Once downloaded unpack the archive (zip for Windows; tarball for Linux and macOS) to extract the executable binary. + +3. If you want to use from any location you must put the binary executable to your `Path` or add the directory where is it to the environment variables. + +### Using [`Go`](https://go.dev/dl/) toolchain + ```bash git clone https://github.com/lucasepe/modgv.git cd modgv