Skip to content

Commit

Permalink
v0.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Garbrandt committed Apr 3, 2021
1 parent 79922f1 commit 58d1d84
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 49 deletions.
66 changes: 17 additions & 49 deletions .github/workflows/release.yml
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
64 changes: 64 additions & 0 deletions .goreleaser.yml
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']

0 comments on commit 58d1d84

Please sign in to comment.