-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy path.goreleaser.yml
More file actions
133 lines (120 loc) · 3.96 KB
/
Copy path.goreleaser.yml
File metadata and controls
133 lines (120 loc) · 3.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
version: 2
project_name: kosli
before:
hooks:
- go mod tidy
- rm -rf npm/cli-*/bin
- find npm -name "*.tgz" -delete
builds:
- id: kosli
binary: kosli
ldflags:
- -w -s
- -X github.com/kosli-dev/cli/internal/version.version={{ .Tag }}
- -X github.com/kosli-dev/cli/internal/version.gitCommit={{ .FullCommit }}
- -X github.com/kosli-dev/cli/internal/version.gitTreeState=clean
- -extldflags "-static"
env:
- CGO_ENABLED=0
- GO111MODULE=on
goos:
- darwin
- linux
- windows
goarch:
- amd64
- arm64
- arm
- s390x
ignore:
- goos: windows
goarch: arm
- goos: windows
goarch: s390x
- goos: darwin
goarch: s390x
main: ./cmd/kosli/
hooks:
post:
- cmd: >-
bash -c '
ARCH="{{ .Arch }}";
if [ "$ARCH" = "s390x" ]; then exit 0; fi;
OS="{{ .Os }}";
[ "$OS" = "windows" ] && OS="win32";
[ "$ARCH" = "amd64" ] && ARCH="x64";
EXT="";
[ "{{ .Os }}" = "windows" ] && EXT=".exe";
mkdir -p npm/cli-${OS}-${ARCH}/bin &&
cp "{{ .Path }}" npm/cli-${OS}-${ARCH}/bin/kosli${EXT} &&
chmod +x npm/cli-${OS}-${ARCH}/bin/kosli${EXT}'
archives:
-
# Can be used to change the archive formats for specific GOOSs.
# Most common use case is to archive as zip on Windows.
# Default is empty.
format_overrides:
- goos: windows
formats: [zip]
# docs for nfpm can be found here: https://goreleaser.com/customization/nfpm/
nfpms:
- id: kosli
# You can change the file name of the package.
#
# Default:`{{ .PackageName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}`
file_name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
ids:
- kosli
vendor: Kosli Inc.
homepage: https://kosli.com/
maintainer: Mike Long <mike@kosli.com>
description: CLI client for reporting compliance events to https://kosli.com
license: MIT
# Formats to be generated.
formats:
- deb
- rpm
# Template to the path that the binaries should be installed.
# Defaults to `/usr/bin`.
bindir: /usr/bin
# Section.
section: misc
# Priority.
priority: optional
# Contents to add to the package.
# GoReleaser will automatically add the binaries.
contents:
# The src and dst attributes also supports name templates
- src: dist/{{ .ProjectName }}_{{ .Os }}_{{ if .Amd64 }}{{ .Arch }}_v1{{ else if .Arm }}{{ .Arch }}_6{{ else if eq .Arch "arm64" }}{{ .Arch }}_v8.0{{ else }}{{ .Arch }}{{ end }}/kosli
dst: /usr/local/bin/kosli
after:
hooks:
- cmd: bash scripts/npm-publish.sh "{{ .Version }}"{{ if or .IsSnapshot (not .IsRelease) }} --dry-run{{ end }}
# after hooks suppresses output by default. You need to add output: true to the hook to see the script's messages.
output: true
publishers:
- name: fury.io
# by specifying `packages` id here goreleaser will only use this publisher
# with artifacts identified by this id
ids:
- kosli
dir: "{{ dir .ArtifactPath }}"
cmd: curl -F package=@{{ .ArtifactName }} https://{{ .Env.FURY_TOKEN }}@push.fury.io/kosli/
release:
prerelease: auto
draft: false
disable: false
# Release notes from the tag body, exported by the release workflow. `index`,
# not `.Env.RELEASE_HEADER`: templates run with missingkey=error, so the dot
# form errors on any run where the var is unset (e.g. a local goreleaser run).
header: |
{{ index .Env "RELEASE_HEADER" }}
changelog:
# GitHub's "What's Changed" PR list. Ignores sort/filters/groups — ordering
# and exclusions live in .github/release.yml.
use: github-native