Skip to content

Commit

Permalink
Merge pull request #28 from ak1ra24/githubactions/goreleaser
Browse files Browse the repository at this point in the history
change github actions yaml & goreleaser.yml
  • Loading branch information
slankdev committed Feb 6, 2020
2 parents ea206b5 + 245dcae commit 806006e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 17 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,10 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Build
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GO111MODULE: on
GOPATH: /home/runner/work/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go get -u github.com/x-motemen/gobump/cmd/gobump
go get -u github.com/tcnksm/ghr
go get -u github.com/Songmu/ghch/cmd/ghch
go get -u github.com/Songmu/goxz/cmd/goxz
export TAGNAME=$($GOPATH/bin/gobump show -r cmd/)
echo "DEBUG:" $TAGNAME
$GOPATH/bin/goxz -pv $TAGNAME -os=linux -arch=amd64 -d ./dist/v$TAGNAME
$GOPATH/bin/ghr -n=v$TAGNAME -b="$($GOPATH/bin/ghch -F markdown --latest)" -draft v$TAGNAME ./dist/v$TAGNAME
6 changes: 1 addition & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,14 @@ jobs:
build:
name: all
runs-on: ubuntu-latest
strategy:
matrix:
go:
- 1.13
steps:
- name: checkout
uses: actions/checkout@v1

- name: set up Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
go-version: 1.13
id: go

- name: cache
Expand Down
22 changes: 22 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
project_name: tinet
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
builds:
- main: .
binary: tinet
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X main.Revision={{.ShortCommit}}
env:
- CGO_ENABLED=0
archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}v{{ .Version }}{{ end }}'
replacements:
linux: linux
amd64: x86_64
release:
prerelease: auto

0 comments on commit 806006e

Please sign in to comment.