diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..2d3b451 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,93 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com +before: + hooks: + - go mod tidy + - go generate ./... +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - "386" + - arm +archives: + - replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + +release: + draft: true + header: | + ## Hi! 欢迎使用HDU-CLI ({{ .Date }}) + + 此处是版本介绍 + + footer: | + ## 谢谢! + + 以上就是在 {{ .Tag }} 上的改动! + name_template: "{{.ProjectName}}-v{{.Version}} {{.Env.USER}}" + + +nfpms: + - + # ID of the nfpm config, must be unique. + # Defaults to "default". + id: packages + + # Replacements for GOOS and GOARCH in the package name. + # Keys should be valid GOOSs or GOARCHs. + # Values are the respective replacements. + # Default is empty. + replacements: + amd64: 64-bit + 386: 32-bit + darwin: macOS + linux: Tux + + # Your app's vendor. + # Default is empty. + vendor: HDUHELP + + # Template to your app's homepage. + # Default is empty. + homepage: https://github.com/hduhelp/hdu-cli + + # Your app's maintainer (probably you). + # Default is empty. + maintainer: HDUHELP + # Your app's license. + # Default is empty. + license: Apache 2.0 + + # Formats to be generated. + formats: + - deb + - rpm + +publishers: + - name: fury.io + # by specifying `packages` id here goreleaser will only use this publisher + # with artifacts identified by this id{{ .Env.FURY_TOKEN }} + ids: + - packages + dir: "{{ dir .ArtifactPath }}" + cmd: curl -F package=@{{ .ArtifactName }} https://{{ .Env.FURY_TOKEN }}@push.fury.io/netdevops/