-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
824aff9
commit 0c55c75
Showing
4 changed files
with
92 additions
and
2 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,30 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" | ||
|
||
jobs: | ||
release: | ||
runs-on: macos-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: setup go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.x | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install goreleaser | ||
run: | | ||
# see: https://goreleaser.com/install/ | ||
brew install goreleaser | ||
- name: Create release using goreleaser | ||
run: | | ||
# see: https://goreleaser.com/quick-start/ | ||
goreleaser release |
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,33 @@ | ||
# see: https://goreleaser.com | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
# https://goreleaser.com/customization/build/ | ||
id: sgi | ||
binary: sgi | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
ldflags: | ||
- -X main.revision={{.ShortCommit}} -X main.version={{.Tag}} | ||
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:" |
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,28 @@ | ||
#!/bin/bash | ||
# | ||
# Description: | ||
# Add a new tag and push it to origin | ||
# | ||
# Usage: | ||
# bash tag_push.sh 0.1.4 | ||
# | ||
set -euo pipefail | ||
|
||
# No arguments | ||
if [[ "$#" = 0 ]]; then | ||
echo "You need to give 1 argument as a new tag version." | ||
echo "e.g.) bash tag_push.sh 0.1.4" | ||
exit 1 | ||
fi | ||
|
||
# Wrong arguments | ||
if [[ ! "$1" =~ "v"?([0-9]\.[0-9]\.[0-9]) ]]; then | ||
echo "new tag version $1 is not correct." | ||
echo "please follow the semantic versioning rule (e.g. 0.1.4 or v0.1.4)" | ||
exit 1 | ||
fi | ||
|
||
# add tag | ||
git tag "v${BASH_REMATCH[1]}" | ||
# push tag | ||
git push origin --tag |
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