-
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
Showing
4 changed files
with
70 additions
and
25 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 |
---|---|---|
@@ -1,37 +1,34 @@ | ||
# workflow name | ||
name: release | ||
name: goreleaser | ||
|
||
|
||
|
||
|
||
# on events | ||
on: | ||
release: | ||
types: | ||
- created | ||
push: | ||
tags: | ||
- '*' | ||
|
||
# jobs | ||
jobs: | ||
# generate build cross-platform build files | ||
generate: | ||
name: Generate cross-platform builds | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# step 1: checkout repository code | ||
- name: Checkout the repository | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
# step 2: generate build files | ||
- name: Generate build files | ||
uses: thatisuday/go-build-action@v1 | ||
with: | ||
platforms: "linux/amd64, darwin/amd64, windows/amd64" | ||
package: "" | ||
name: "urlencode" | ||
compress: "true" | ||
dest: "dist" | ||
|
||
# step 3: upload build-artifacts | ||
- name: Upload build-artifacts | ||
uses: skx/github-action-publish-binaries@master | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15 | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
args: "./dist/*.tar.gz" |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
*.exe | ||
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,37 @@ | ||
# This is an example goreleaser.yaml file with some sane defaults. | ||
# Make sure to check the documentation at http://goreleaser.com | ||
before: | ||
hooks: | ||
# You may remove this if you don't use go modules. | ||
- go mod download | ||
# you may remove this if you don't need go generate | ||
- go generate ./... | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
ldflags: | ||
- -s -w -X main.version={{.Version}} | ||
archives: | ||
- replacements: | ||
darwin: MacOS | ||
linux: Linux | ||
windows: Windows | ||
386: 32bit | ||
amd64: 64bit | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ .Tag }}" | ||
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