Skip to content

Commit

Permalink
add goreleaser and related github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasepe committed Feb 23, 2023
1 parent f387e91 commit 963e14b
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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 }}

38 changes: 38 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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
Expand Down

0 comments on commit 963e14b

Please sign in to comment.