Skip to content

Commit

Permalink
Add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
sue445 committed Dec 3, 2019
1 parent 03fc28a commit 1e6f429
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release
on:
push:
branches:
- "!**/*"
tags:
- "v*"

env:
GO111MODULE: "on"

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: make package and release
run: |
set -xe
export GOPATH=`go env GOPATH`
export PATH=$GOPATH/bin:$PATH
export PUSH_EVENT_REF=$(jq --raw-output .ref "$GITHUB_EVENT_PATH")
if [ "$(echo $PUSH_EVENT_REF | grep refs/tags/ | wc -l)" = "0" ]; then
echo "ref is not a tag: ${PUSH_EVENT_REF}"
exit 1
fi
export TAGNAME=$(echo $PUSH_EVENT_REF | sed -e 's!refs/tags/!!g')
go get -u github.com/mitchellh/gox
make clean gox_with_zip
go get -u github.com/tcnksm/ghr
$GOPATH/bin/ghr -n ${TAGNAME} -b "Release ${TAGNAME}" ${TAGNAME} bin/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Slack Notification
uses: homoluctus/slatify@v2.0.0
if: always()
with:
job_name: '*release*'
type: ${{ job.status }}
icon_emoji: ":octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 1e6f429

Please sign in to comment.