-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from Abirdcfly/main
feat: add gorelease to release binary
- Loading branch information
Showing
5 changed files
with
281 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
# run only against tags | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write | ||
# packages: write | ||
# issues: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- run: git fetch --force --tags | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: "go.mod" | ||
# More assembly might be required: Docker logins, GPG, etc. It all depends | ||
# on your needs. | ||
- uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
# either 'goreleaser' (default) or 'goreleaser-pro': | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' | ||
# distribution: | ||
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -244,3 +244,5 @@ Network Trash Folder | |
Temporary Items | ||
.apdisk | ||
|
||
|
||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,218 @@ | ||
# This is an example .goreleaser.yml file with some sensible defaults. | ||
# Make sure to check the documentation at https://goreleaser.com | ||
#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: | ||
- env: | ||
- CGO_ENABLED=0 | ||
main: ./cmd/bc-cli/ | ||
ldflags: | ||
- -s -w -X k8s.io/component-base/version.gitVersion={{.Version}} -X k8s.io/component-base/version.gitCommit={{.Commit}} -X k8s.io/component-base/version.buildDate={{.Date}} | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
|
||
archives: | ||
- format: tar.gz | ||
# this name template makes the OS and Arch compatible with the results of uname. | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else if eq .Arch "386" }}i386 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
{{- if .Arm }}v{{ .Arm }}{{ end }} | ||
# use zip for windows archives | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ incpatch .Version }}-next" | ||
changelog: | ||
# Sorts the changelog by the commit's messages. | ||
# Could either be asc, desc or empty | ||
sort: asc | ||
# Changelog generation implementation to use. | ||
# | ||
# Valid options are: | ||
# - `git`: uses `git log`; | ||
# - `github`: uses the compare GitHub API, appending the author login to the changelog. | ||
# - `gitlab`: uses the compare GitLab API, appending the author name and email to the changelog. | ||
# - `github-native`: uses the GitHub release notes generation API, disables the groups feature. | ||
# | ||
# Default: 'git' | ||
use: github | ||
# Group commits messages by given regex and title. | ||
# Order value defines the order of the groups. | ||
# Providing no regex means all commits will be grouped under the default group. | ||
# Groups are disabled when using github-native, as it already groups things by itself. | ||
# Matches are performed against strings of the form: "<abbrev-commit>[:] <title-commit>". | ||
# Regex use RE2 syntax as defined here: https://github.com/google/re2/wiki/Syntax. | ||
groups: | ||
- title: New Features | ||
regexp: "^.*feat[(\\w)]*:+.*$" | ||
order: 0 | ||
- title: 'Bug Fixes' | ||
regexp: "^.*fix[(\\w)]*:+.*$" | ||
order: 1 | ||
- title: Others | ||
order: 999 | ||
filters: | ||
# Commit messages matching the regexp listed here will be removed from | ||
# the changelog | ||
exclude: | ||
- '^Merge pull request' | ||
release: | ||
# Repo in which the release will be created. | ||
# Default is extracted from the origin remote URL or empty if its private hosted. | ||
# github: | ||
# owner: user | ||
# name: repo | ||
|
||
# IDs of the archives to use. | ||
# Empty means all IDs. | ||
# | ||
# Default: [] | ||
# ids: | ||
# - foo | ||
# - bar | ||
|
||
# If set to true, will not auto-publish the release. | ||
# Available only for GitHub and Gitea. | ||
# | ||
# Default: false | ||
draft: true | ||
|
||
# Whether to remove existing draft releases with the same name before creating | ||
# a new one. | ||
# Only effective if `draft` is set to true. | ||
# Available only for GitHub. | ||
# | ||
# Default: false | ||
# Since: v1.11 | ||
replace_existing_draft: false | ||
|
||
# Useful if you want to delay the creation of the tag in the remote. | ||
# You can create the tag locally, but not push it, and run GoReleaser. | ||
# It'll then set the `target_commitish` portion of the GitHub release to the | ||
# value of this field. | ||
# Only works on GitHub. | ||
# | ||
# Default: '' | ||
# Since: v1.11 | ||
# Templates: allowed | ||
# target_commitish: '{{ .Commit }}' | ||
|
||
# This allows to change which tag GitHub will create. | ||
# Usually you'll use this together with `target_commitish`, or if you want to | ||
# publish a binary from a monorepo into a public repository somewhere, without | ||
# the tag prefix. | ||
# | ||
# Default: '{{ .PrefixedCurrentTag }}' | ||
# Since: v1.19 (pro) | ||
# Templates: allowed | ||
# tag: '{{ .CurrentTag }}' | ||
|
||
# If set, will create a release discussion in the category specified. | ||
# | ||
# Warning: do not use categories in the 'Announcement' format. | ||
# Check https://github.com/goreleaser/goreleaser/issues/2304 for more info. | ||
# | ||
# Default is empty. | ||
# discussion_category_name: General | ||
|
||
# If set to auto, will mark the release as not ready for production | ||
# in case there is an indicator for this in the tag e.g. v1.0.0-rc1 | ||
# If set to true, will mark the release as not ready for production. | ||
# Default is false. | ||
# prerelease: auto | ||
|
||
# What to do with the release notes in case there the release already exists. | ||
# | ||
# Valid options are: | ||
# - `keep-existing`: keep the existing notes | ||
# - `append`: append the current release notes to the existing notes | ||
# - `prepend`: prepend the current release notes to the existing notes | ||
# - `replace`: replace existing notes | ||
# | ||
# Default is `keep-existing`. | ||
mode: append | ||
|
||
# Header for the release body. | ||
# | ||
# Templates: allowed | ||
header: | | ||
## {{.ProjectName}}-v{{.Version}} | ||
Welcome to this new release! | ||
### Breaking Changes: | ||
None | ||
### Feature summary 🚀 🚀 🚀 | ||
# Footer for the release body. | ||
# | ||
# Templates: allowed | ||
footer: | | ||
## Thanks to our Contributors! | ||
Thank you to everyone who contributed to {{.Tag}}! ❤️ | ||
And thank you very much to everyone else not listed here who contributed in other ways like filing issues, giving feedback, testing fixes, helping users in slack, etc. 🙏 | ||
# You can change the name of the release. | ||
# | ||
# Default: '{{.Tag}}' ('{{.PrefixedTag}}' on Pro) | ||
# Templates: allowed | ||
name_template: "v{{.Version}}" | ||
|
||
# You can disable this pipe in order to not create the release on any SCM. | ||
# Keep in mind that this might also break things that depend on the release | ||
# URL, for instance, homebrew taps. | ||
# | ||
# Templates: allowed (since v1.15) | ||
# disable: true | ||
|
||
# Set this to true if you want to disable just the artifact upload to the SCM. | ||
# If this is true, GoReleaser will still create the release with the | ||
# changelog, but won't upload anything to it. | ||
# | ||
# Since: v1.11 | ||
# Templates: allowed (since v1.15) | ||
# skip_upload: true | ||
|
||
# You can add extra pre-existing files to the release. | ||
# The filename on the release will be the last part of the path (base). | ||
# If another file with the same name exists, the last one found will be used. | ||
# | ||
# Templates: allowed | ||
# extra_files: | ||
# - glob: ./path/to/file.txt | ||
# - glob: ./glob/**/to/**/file/**/* | ||
# - glob: ./glob/foo/to/bar/file/foobar/override_from_previous | ||
# - glob: ./single_file.txt | ||
# name_template: file.txt # note that this only works if glob matches 1 file only | ||
|
||
|
||
# Additional templated extra files to add to the release. | ||
# Those files will have their contents pass through the template engine, | ||
# and its results will be added to the release. | ||
# | ||
# Since: v1.17 (pro) | ||
# This feature is only available in GoReleaser Pro. | ||
# Templates: allowed | ||
# templated_extra_files: | ||
# - src: LICENSE.tpl | ||
# dst: LICENSE.txt | ||
|
||
# The lines beneath this are called `modelines`. See `:help modeline` | ||
# Feel free to remove those if you don't want/use them. | ||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json | ||
# vim: set ts=2 sw=2 tw=0 fo=cnqoj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters