Skip to content

Commit

Permalink
Release preparation
Browse files Browse the repository at this point in the history
Upgrading goreleaser.
  • Loading branch information
noborus committed Jul 14, 2024
1 parent 551b713 commit 9d3de00
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Go
if: success()
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
Expand Down
27 changes: 12 additions & 15 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
version: 2

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
Expand All @@ -16,16 +14,8 @@ builds:
id: "guesswidth"
main: ./cmd/guesswidth
archives:
- name_template: >-
{{ .ProjectName }}_
{{- .Version }}_
{{- if eq .Os "freebsd" }}FreeBSD
{{- else }}{{ title .Os }}{{ end }}_
{{- if eq .Arch "amd64" }}64bit
{{- else if eq .Arch "386" }}32bit
{{- else if eq .Arch "arm64" }}ARM64
{{- else if eq .Arch "riscv64" }}RISCV
{{- else }}{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ end }}
- name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"

checksum:
name_template: 'checksums.txt'
snapshot:
Expand All @@ -37,10 +27,17 @@ changelog:
- '^docs:'
- '^test:'
brews:
- tap:
-
name: guesswidth
repository:
owner: noborus
name: homebrew-tap
token: "{{ .Env.TAP_GITHUB_TOKEN }}"
commit_author:
name: noborus
email: [email protected]
description: "guesses the column position for fixed-width formats(fwf)"
homepage: "https://noborus.github.io/"

# modelines, feel free to remove those if you don't want/use them:
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
Expand Down
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,42 @@ PID,TTY,TIME,CMD
733213,pts/3,00:00:00,guesswidth
```

##
```console
ps | guesswidth --align
PID|TTY | TIME|CMD
302965|pts/3|00:00:12|zsh
733211|pts/3|00:00:00|ps
733212|pts/3|00:00:00|tee
733213|pts/3|00:00:00|guesswidth
```

## Usage

```console
$ guesswidth -h [~/dev/src/github.com/noborus/guesswidth]
Guess the width of the columns from the header and body,
split them, insert fences and output.

Usage:
guesswidth [flags]
guesswidth [command]

Available Commands:
completion Generate the autocompletion script for the specified shell
csv Output in csv format
help Help about any command

Flags:
-a, --align align the output
--fence string fence (default "|")
--header int header line number (default 1)
-h, --help help for guesswidth
--scannum int number of line to scan (default 100)
--split int maximum number of splits (default -1)
-v, --version version for guesswidth

Use "guesswidth [command] --help" for more information about a command.
```

## Examples

Expand Down

0 comments on commit 9d3de00

Please sign in to comment.