-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
2 changed files
with
81 additions
and
49 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,59 +1,27 @@ | ||
name: release | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- '**' | ||
create: | ||
tags: | ||
- 'v*.*.*' | ||
- v*.*.* | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
container: | ||
image: bepsays/ci-goreleaser:1.16.0 | ||
steps: | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.15 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set tag to environment variable | ||
run: echo ::set-env name=VCS_REF::${GITHUB_REF#refs/*/} | ||
|
||
- name: Output info to log | ||
run: | | ||
echo $VCS_REF | ||
echo ${{ env.VCS_REF }} | ||
- name: Compile Client with XGO | ||
uses: crazy-max/ghaction-xgo@v1.4.1 | ||
with: | ||
xgo_version: latest | ||
go_version: latest | ||
dest: build | ||
targets: linux/*,windows/*,darwin/* | ||
prefix: tenet-${{ env.VCS_REF }} | ||
v: true | ||
x: false | ||
buildmode: default | ||
ldflags: '-X main.Version=${{ env.VCS_REF }}' | ||
|
||
- name: Zip binaries | ||
run: | | ||
cd build | ||
for file in ./* ; do zip "${file}.zip" "$file" ; done | ||
ls -lah | ||
readlink -e . | ||
- name: Upload release to GitHub | ||
uses: xresloader/upload-to-github-release@v1.2.0 | ||
fetch-depth: 0 | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GO_RELEASER_GITHUB_TOKEN }} | ||
with: | ||
file: '*.zip' | ||
draft: false | ||
tags: true | ||
verbose: true |
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,64 @@ | ||
# GoReleaser config | ||
|
||
before: | ||
hooks: | ||
- go mod tidy | ||
|
||
builds: | ||
- id: tenet_darwin | ||
binary: tenet | ||
goos: | ||
- darwin | ||
goarch: | ||
- amd64 | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=o64-clang | ||
- CXX=o64-clang++ | ||
flags: | ||
- -tags | ||
- sqlite | ||
|
||
- id: tenet_linux | ||
binary: tenet | ||
env: | ||
- CGO_ENABLED=1 | ||
flags: | ||
- -tags | ||
- sqlite | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
|
||
- id: tenet_windows_x64 | ||
binary: tenet | ||
ldflags: | ||
- "-extldflags '-static'" | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=x86_64-w64-mingw32-gcc | ||
- CXX=x86_64-w64-mingw32-g++ | ||
flags: | ||
- -tags | ||
- sqlite | ||
goos: | ||
- windows | ||
goarch: | ||
- amd64 | ||
|
||
archives: | ||
- format_overrides: | ||
- goos: 'windows' | ||
format: 'zip' | ||
|
||
checksum: | ||
name_template: 'checksums.txt' | ||
|
||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
|
||
changelog: | ||
sort: 'asc' | ||
filters: | ||
exclude: ['^docs:', '^test:', 'Merge pull request', 'Merge branch'] |