Skip to content

Commit

Permalink
add .goreleaser.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
aooohan committed Dec 17, 2023
1 parent 04a8d7f commit 83f61bb
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 32 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/go-binary-release.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/go-releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ jobs:
distribution: goreleaser
version: latest
args: release --clean ${{ env.flags }}
workdir: ./cmd
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112 changes: 112 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# .goreleaser.yaml
before:
hooks:
- go mod tidy
builds:
- binary: 'vfox'
main: './cmd'
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- "386"
- amd64
- arm
- arm64
- ppc64
goarm:
- "7"
ignore:
- goos: windows
goarch: arm
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X main.builtBy=goreleaser -X main.treeState={{ .IsGitDirty }}

checksum:
name_template: "checksums.txt"

changelog:
sort: asc
use: github
filters:
exclude:
- "^test:"
- "^chore"
- "merge conflict"
- Merge pull request
- Merge remote-tracking branch
- Merge branch
- go mod tidy
groups:
- title: Dependency updates
regexp: '^.*?(feat|fix)\(deps\)!?:.+$'
order: 300
- title: "New Features"
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
order: 100
- title: "Security updates"
regexp: '^.*?sec(\([[:word:]]+\))??!?:.+$'
order: 150
- title: "Bug fixes"
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
order: 200
- title: "Documentation updates"
regexp: ^.*?doc(\([[:word:]]+\))??!?:.+$
order: 400
- title: "Build process updates"
regexp: ^.*?build(\([[:word:]]+\))??!?:.+$
order: 400
- title: Other work
order: 9999

brews:
- name: 'vfox'
repository:
owner: aooohan
name: vfox-homebrew-tap
token: "{{ .Env.HOMEBREW_TOKEN }}"
folder: Formula
goarm: "7"
homepage: https://github.com/aooohan/version-fox
description: A cross-platform SDK version manager with a simple cli.
url_template: "https://github.com/aooohan/version-fox/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
license: "Apache-2.0"
commit_author:
name: lihan
email: [email protected]
dependencies:
- name: go
type: optional
- name: git
test: |
system "#{bin}/vfox version"
winget:
- name: vfox
publisher: lihan
license: 'Apache-2.0'
homepage: https://github.com/aooohan/version-fox
short_description: A cross-platform SDK version manager with a simple cli.
repository:
owner: aooohan
name: vfox-winget-pkgs
branch: "vfox-{{.Version}}"
pull_request:
enabled: true
draft: true
base:
owner: microsoft
name: winget-pkgs
branch: master

release:
name_template: "v{{ .Version }}"
footer: |
**Full Changelog**: https://github.com/aooohan/version-fox/compare/{{ .PreviousTag }}...{{ if .IsNightly }}nightly{{ else }}{{ .Tag }}{{ end }}
12 changes: 12 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ func main() {
app.Description = "VersionFox is a tool for sdk version management, which allows you to quickly install and use different versions of targeted sdk via the command line."
app.Suggest = true
app.Commands = []*cli.Command{
{
Name: "info",
Usage: "show info of plugin",
Action: func(ctx *cli.Context) error {
args := ctx.Args()
l := args.Len()
if l < 2 {
return cli.Exit("invalid arguments", 1)
}
return manager.Add(args.Get(0), args.Get(1))
},
},
{
Name: "add",
Usage: "add a plugin of sdk",
Expand Down

0 comments on commit 83f61bb

Please sign in to comment.