Skip to content

Commit

Permalink
include goreleaser
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmet Turkmen <[email protected]>
  • Loading branch information
mrtrkmn committed Jan 17, 2021
1 parent 616db87 commit 6273000
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: goreleaser

on:
push:
tags:
- 'v*.*.*'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82 changes: 82 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# .goreleaser.yml
before:
hooks:
- go mod tidy
builds:
# You can have multiple builds defined as a yaml list
- # ID of the build.
# Defaults to the project name.
id: "topx"

env:
- CGO_ENABLED=0

main: ./main/main.go

binary: topx

flags:
- -tags=netgo
ldflags:
- -s -w -X main.version={{ .Version }}
goos:
- linux
goarch:
- 386
- amd64

archives:
- # ID of this archive.
# Defaults to `default`.
id: topx-build

# Builds reference which build instances should be archived in this archive.
builds:
- topx-build

# Archive name template.
# Defaults:
# - if format is `tar.gz`, `gz` or `zip`:
# - `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}`
# - if format is `binary`:
# - `{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}`
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"


# Replacements for GOOS and GOARCH in the archive name.
# Keys should be valid GOOSs or GOARCHs.
# Values are the respective replacements.
# Default is empty.
replacements:
amd64: 64-bit


# Set to true, if you want all files in the archive to be in a single directory.
# If set to true and you extract the archive 'goreleaser_Linux_arm64.tar.gz',
# you get a folder 'goreleaser_Linux_arm64'.
# If set to false, all files are extracted separately.
# You can also set it to a custom folder name (templating is supported).
# Default is false.
wrap_in_directory: true

# Archive format. Valid options are `tar.gz`, `gz`, `zip` and `binary`.
# If format is `binary`, no archives are created and the binaries are instead
# uploaded directly.
# Default is `tar.gz`.
format: zip

# Additional files/globs you want to add to the archive.
# Defaults are any files matching `LICENCE*`, `LICENSE*`,
# `README*` and `CHANGELOG*` (case-insensitive).
files:
- readme.md

checksum:
# You can change the name of the checksums file.
# Default is `{{ .ProjectName }}_{{ .Version }}_checksums.txt`.
name_template: "v_{{ .Version }}_{{ .ProjectName }}_checksums.txt"

# Algorithm to be used.
# Accepted options are sha256, sha512, sha1, crc32, md5, sha224 and sha384.
# Default is sha256.
algorithm: sha256

0 comments on commit 6273000

Please sign in to comment.