Skip to content

Commit

Permalink
migrate to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
elvis committed Sep 12, 2019
1 parent 025d8e0 commit 1d34c27
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 6 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Go

on:
push:
branches:
- master

jobs:

build:
name: Build
runs-on: ubuntu-16.04
steps:

- name: Set up Go 1.12
uses: actions/setup-go@v1
with:
go-version: 1.12
id: go

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

- name: Get github-release
run: go get -v github.com/aktau/github-release

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GithubActionsToken }}
run: PATH=$(go env GOPATH)/bin:${PATH} make release

9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
OWNER = lnmpy
REPO = realpath
TAG = `git describe --tags`
TAG = v$(shell grep -o -P '\d+.\d+.\d+' version.go)


build: clean
GO111MODULE=on go build -o realpath

tag: build
git tag ${TAG}
git push --tags
go build -o realpath

release: clean
GOOS=darwin GOARCH=amd64 go build -o realpath && tar -czf realpath_darwin.tar.gz realpath
GOOS=linux GOARCH=amd64 go build -o realpath && tar -czf realpath_linux.tar.gz realpath
GOOS=windows GOARCH=amd64 go build -o realpath.exe && tar -czf realpath_windows.tar.gz realpath.exe
-github-release delete -u ${OWNER} -r ${REPO} -t ${TAG}
github-release release -u ${OWNER} -r ${REPO} -t ${TAG} -n ${TAG}
github-release upload -u ${OWNER} -r ${REPO} -t ${TAG} -n "realpath_darwin.tar.gz" -f realpath_darwin.tar.gz
github-release upload -u ${OWNER} -r ${REPO} -t ${TAG} -n "realpath_linux.tar.gz" -f realpath_linux.tar.gz
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
module github.com/lnmpy/realpath

go 1.12
3 changes: 3 additions & 0 deletions version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package main

const VERSION = "1.0.0"

0 comments on commit 1d34c27

Please sign in to comment.