Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

dist/
# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

dist/
181 changes: 107 additions & 74 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,80 +57,80 @@ builds:
# - v2
# - v3

dockers:
# You can declare multiple Docker images.
# They will be matched against the binaries generated by your builds section
# and packages generated by your nfpms section.
# dockers:
# # You can declare multiple Docker images.
# # They will be matched against the binaries generated by your builds section
# # and packages generated by your nfpms section.

# Templates of the Docker image names.
# if prefix URL, docker img will push.
- image_templates:
- "docker.io/brothersam/guanceexample:{{ .Version }}-amd64"
# - "gcr.io/brothersam/guanceexample:{{ .Version }}"
# - "brothersam/guanceexample:{{ .Version }}"

# GOOS of the built binaries/packages that should be used.
# goos: linux

# GOARCH of the built binaries/packages that should be used.
goarch: amd64

# GOAMD64 of the built binaries/packages that should be used.
# goamd64: 'v2'

# Skips the docker push.
# Could be useful if you also do draft releases.
# If set to auto, the release will not be pushed to the Docker repository
# in case there is an indicator of a prerelease in the tag, e.g. v1.0.0-rc1.
# Defaults to false.
skip_push: false

# Path to the Dockerfile (from the project root).
# Defaults to `Dockerfile`.
dockerfile: Dockerfile

# Set the "backend" for the Docker pipe.
# Valid options are: docker, buildx, podman.
# podman is a GoReleaser Pro feature and is only available on Linux.
# Defaults to docker.
use: docker

# Template of the docker build flags.
build_flag_templates:
- --platform=linux/amd64
- --label=guance.image.title={{ .ProjectName }}
- --label=guance.image.description={{ .ProjectName }}
- --label=guance.image.url=https://github.com/brothersam66/testgoreleaser
- --label=guance.image.source=https://github.com/brothersam66/testgoreleaser
- --label=guance.image.version={{ .Version }}
- --label=guance.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=guance.image.revision={{ .FullCommit }}
- --label=guance.image.licenses=MIT

- image_templates:
- "docker.io/brothersam/guanceexample:{{ .Version }}-arm64v8"
# goos: linux
goarch: arm64
# goarm: 'v6'
skip_push: false
dockerfile: Dockerfile
use: docker
build_flag_templates:
- --platform=linux/arm64/v8
- --label=guance.image.title={{ .ProjectName }}
- --label=guance.image.description={{ .ProjectName }}
- --label=guance.image.url=https://github.com/brothersam66/testgoreleaser
- --label=guance.image.source=https://github.com/brothersam66/testgoreleaser
- --label=guance.image.version={{ .Version }}
- --label=guance.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=guance.image.revision={{ .FullCommit }}
- --label=guance.image.licenses=MIT

docker_manifests:
- name_template: docker.io/brothersam/guanceexample:{{ .Version }}
image_templates:
- docker.io/brothersam/guanceexample:{{ .Version }}-amd64
- docker.io/brothersam/guanceexample:{{ .Version }}-arm64v8
# # Templates of the Docker image names.
# # if prefix URL, docker img will push.
# - image_templates:
# - "docker.io/brothersam/guanceexample:{{ .Version }}-amd64"
# # - "gcr.io/brothersam/guanceexample:{{ .Version }}"
# # - "brothersam/guanceexample:{{ .Version }}"

# # GOOS of the built binaries/packages that should be used.
# # goos: linux

# # GOARCH of the built binaries/packages that should be used.
# goarch: amd64

# # GOAMD64 of the built binaries/packages that should be used.
# # goamd64: 'v2'

# # Skips the docker push.
# # Could be useful if you also do draft releases.
# # If set to auto, the release will not be pushed to the Docker repository
# # in case there is an indicator of a prerelease in the tag, e.g. v1.0.0-rc1.
# # Defaults to false.
# skip_push: false

# # Path to the Dockerfile (from the project root).
# # Defaults to `Dockerfile`.
# dockerfile: Dockerfile

# # Set the "backend" for the Docker pipe.
# # Valid options are: docker, buildx, podman.
# # podman is a GoReleaser Pro feature and is only available on Linux.
# # Defaults to docker.
# use: docker

# # Template of the docker build flags.
# build_flag_templates:
# - --platform=linux/amd64
# - --label=guance.image.title={{ .ProjectName }}
# - --label=guance.image.description={{ .ProjectName }}
# - --label=guance.image.url=https://github.com/brothersam66/testgoreleaser
# - --label=guance.image.source=https://github.com/brothersam66/testgoreleaser
# - --label=guance.image.version={{ .Version }}
# - --label=guance.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
# - --label=guance.image.revision={{ .FullCommit }}
# - --label=guance.image.licenses=MIT

# - image_templates:
# - "docker.io/brothersam/guanceexample:{{ .Version }}-arm64v8"
# # goos: linux
# goarch: arm64
# # goarm: 'v6'
# skip_push: false
# dockerfile: Dockerfile
# use: docker
# build_flag_templates:
# - --platform=linux/arm64/v8
# - --label=guance.image.title={{ .ProjectName }}
# - --label=guance.image.description={{ .ProjectName }}
# - --label=guance.image.url=https://github.com/brothersam66/testgoreleaser
# - --label=guance.image.source=https://github.com/brothersam66/testgoreleaser
# - --label=guance.image.version={{ .Version }}
# - --label=guance.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
# - --label=guance.image.revision={{ .FullCommit }}
# - --label=guance.image.licenses=MIT

# docker_manifests:
# - name_template: docker.io/brothersam/guanceexample:{{ .Version }}
# image_templates:
# - docker.io/brothersam/guanceexample:{{ .Version }}-amd64
# - docker.io/brothersam/guanceexample:{{ .Version }}-arm64v8

# GoReleaser can be wired to nfpm to generate and publish .deb, .rpm and .apk packages.
nfpms:
Expand All @@ -145,4 +145,37 @@ nfpms:


env_files:
github_token: ~/go/src/github.com/github_token
github_token: ~/go/src/github.com/github_token

changelog:
# Set this to true if you don't want any changelog at all.
# Warning: this will also ignore any changelog files passed via `--release-notes`,
# and will render an empty changelog.
# This may result in an empty release notes on GitHub/GitLab/Gitea.
skip: false

# Changelog generation implementation to use.
#
# Valid options are:
# - `git`: uses `git log`;
# - `github`: uses the compare GitHub API, appending the author login to the changelog.
# - `gitlab`: uses the compare GitLab API, appending the author name and email to the changelog.
# - `github-native`: uses the GitHub release notes generation API, disables the groups feature.
#
# Defaults to `git`.
use: github

# Sorts the changelog by the commit's messages.
# Could either be asc, desc or empty
# Default is empty
sort: asc

# Max commit hash length to use in the changelog.
#
# 0: use whatever the changelog implementation gives you
# -1: remove the commit hash from the changelog
# any other number: max length.
#
# Default: 0.
# Since: v1.11.2
abbrev: -1
17 changes: 17 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ import (
)

func main() {
str := `
GGGG l
GG GG l
GG G l
GG G l
GG G l
GG oooo r rrr eee l eee aaaa ssss eeee r rrr
GG GGGG o oo r rr e ee l e ee aa aa s ss e ee r rr
GG GG oo o r rr ee e l ee e aa s ee e r rr
GG GG o oo rr eeeeeee l eeeeeee aaaaaa ssss eeeeeee rr
GG GG o oo r ee l ee aa a sss ee r
GG GG oo o r ee e l ee e aa aa ss s ee e r
GG GGG o oo r e ee l e ee aa aaa s ss e ee r
GGG GG oooo r eeee ll eeee aaa a ssss eeee r
`

fmt.Println(str)
const Timeout = 10
x := 9
y := 5
Expand Down
2 changes: 1 addition & 1 deletion release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ git commit -m "testcommit"
# master: your branch name
git push origin master
# vXX.XX.XX: your version. your tag
git tag -a v0.3.23 -m "test release"
git tag -a v0.3.33 -m "test release"
# release and push to github & docker.io
goreleaser release --rm-dist
# only test realase
Expand Down