Skip to content

Commit

Permalink
Use goreleaser (#22)
Browse files Browse the repository at this point in the history
* Add config for goreleaser
  • Loading branch information
jfantinhardesty authored Oct 19, 2023
1 parent 3e6222d commit 7c7864b
Show file tree
Hide file tree
Showing 2 changed files with 153 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ gui/pyside6/__pycache__/
cloudfuse-logs.txt
ui_*.py
test/scripts/dirIterate.go
**/logfile.txt
**/logfile.txt
dist/
151 changes: 151 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# The lines bellow are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

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:
- id: windows
goos:
- windows
goarch:
- amd64
env:
- CGO_ENABLED=0
flags:
- -trimpath
mod_timestamp: '{{ .CommitTimestamp }}'
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }}

- id: linux-amd64
goos:
- linux
goarch:
- amd64
env:
- CGO_ENABLED=1
flags:
- -trimpath
mod_timestamp: '{{ .CommitTimestamp }}'
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }}

- id: linux-arm64
goos:
- linux
goarch:
- arm64
env:
- CGO_ENABLED=1
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
flags:
- -trimpath
mod_timestamp: '{{ .CommitTimestamp }}'
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }}

checksum:
name_template: "checksums_sha256.txt"
algorithm: sha256

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{ .Version }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
files:
- LICENSE
- README.md
- NOTICE
- setup/baseConfig.yaml
- sampleFileCacheConfigAzure.yaml
- sampleFileCacheWithSASConfigAzure.yaml
- sampleFileCacheConfigS3.yaml
- sampleStreamingConfigS3.yaml
- sampleStreamingConfigAzure.yaml

nfpms:
- id: default

# Name of the package.
package_name: cloudfuse

# Build IDs for the builds you want to create NFPM packages for.
# Defaults empty, which means no filtering.
builds:
- linux-amd64
- linux-arm64

vendor: Seagate Technology
homepage: https://github.com/Seagate/cloudfuse
maintainer: https://github.com/Seagate/cloudfuse
description: |-
A FUSE filesystem for interacting with S3 and Azure storage.
license: MIT

# Formats to be generated.
formats:
- deb
- rpm

section: default

# Contents to add to the package.
# GoReleaser will automatically add the binaries.
contents:
# Basic file that applies to all packagers
- src: NOTICE
dst: /usr/share/doc/cloudfuse/NOTICE

- src: LICENSE
dst: /usr/share/doc/cloudfuse/LICENSE

- src: setup/baseConfig.yaml
dst: /usr/share/cloudfuse/baseConfig.yaml

- src: sampleFileCacheConfigAzure.yaml
dst: /usr/share/cloudfuse/sampleFileCacheConfigAzure.yaml

- src: sampleFileCacheConfigS3.yaml
dst: /usr/share/cloudfuse/sampleFileCacheConfigS3.yaml

- src: sampleFileCacheWithSASConfigAzure.yaml
dst: /usr/share/cloudfuse/sampleFileCacheWithSASConfigAzure.yaml

- src: sampleStreamingConfigS3.yaml
dst: /usr/share/cloudfuse/sampleStreamingConfigS3.yaml

- src: sampleStreamingConfigAzure.yaml
dst: /usr/share/cloudfuse/sampleStreamingConfigAzure.yaml

overrides:
deb:
dependencies:
- libfuse-dev

rpm:
dependencies:
- fuse-devel

metadata:
mod_timestamp: "{{ .CommitTimestamp }}"

0 comments on commit 7c7864b

Please sign in to comment.