Skip to content

Commit

Permalink
Add snapcrafts
Browse files Browse the repository at this point in the history
  • Loading branch information
markruler committed Mar 8, 2021
1 parent 9aef146 commit c34c667
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
28 changes: 19 additions & 9 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# http://goreleaser.com
release:
github:
owner: cxsu
name: swage
prerelease: false

env_files:
Expand All @@ -11,25 +14,25 @@ before:
# - go generate ./...

builds:
# - binary: swage
- env:
- binary: swage
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- 386
- arm64
# - 386
# - arm64
ldflags:
- -s -w -extldflags='-static' -X github.com/cxsu/swage/pkg/cmd.swageVersion={{ .Version }}
- -s -w -extldflags='-static' -X github.com/cxsu/swage/pkg/cmd.swageVersion={{ .Tag }}

archives:
- replacements:
# 386: i386 # 32-bit
# amd64: x86_64 # 64-bit
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
name_template: '{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}'
format: tar.gz
format_overrides:
- goos: windows
Expand All @@ -45,8 +48,15 @@ changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- docs
- test
- typo
- Merge pull request
- Merge branch
- go mod tidy

snapcrafts:
# - name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
- name_template: '{{ .ProjectName }}_{{ .Arch }}'
grade: stable
confinement: strict
publish: true
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ release-snapshot:
@goreleaser --snapshot --skip-publish
.PHONY: release

# https://github.com/settings/tokens
# - [x] repo_deployment
# - [x] public_repo
release-publish:
@rm -rf dist
@#git tag --annotate=$(VERSION) --message="release message"
git tag $(VERSION)
git push origin $(VERSION)
goreleaser release --rm-dist
Expand Down

0 comments on commit c34c667

Please sign in to comment.