Skip to content

Commit 8542894

Browse files
committed
use github action to build release bin
1 parent 4402273 commit 8542894

File tree

5 files changed

+92
-121
lines changed

5 files changed

+92
-121
lines changed

.github/workflows/workflow.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
on:
2+
push:
3+
tags:
4+
- 'v*'
5+
6+
name: Build and Release
7+
8+
jobs:
9+
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
14+
- name: Checkout
15+
uses: actions/checkout@master
16+
17+
- name: Build
18+
uses: audibleblink/golang-action@1.5.2
19+
with:
20+
args: make -j3
21+
22+
- name: Get the version
23+
id: get_version
24+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
25+
26+
- name: Create Release
27+
id: create_release
28+
uses: actions/create-release@v1
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
with:
32+
tag_name: ${{ steps.get_version.outputs.VERSION }}
33+
release_name: Release ${{ steps.get_version.outputs.VERSION }}
34+
draft: false
35+
prerelease: false
36+
37+
- name: Upload Windows Release Asset
38+
uses: actions/upload-release-asset@v1
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
with:
42+
upload_url: ${{ steps.create_release.outputs.upload_url }}
43+
asset_path: ./gitls_windows
44+
asset_name: gitls.exe
45+
asset_content_type: application/octet-stream
46+
47+
- name: Upload Linux Release Asset
48+
uses: actions/upload-release-asset@v1
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
with:
52+
upload_url: ${{ steps.create_release.outputs.upload_url }}
53+
asset_path: ./gitls_linux
54+
asset_name: gitls.bin
55+
asset_content_type: application/octet-stream
56+
57+
- name: Upload Release Asset
58+
uses: actions/upload-release-asset@v1
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
with:
62+
upload_url: ${{ steps.create_release.outputs.upload_url }}
63+
asset_path: ./gitls_darwin
64+
asset_name: gitls.app
65+
asset_content_type: application/octet-stream
66+

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.env
22
git-ls
33
data/*
4+
gitls_*

Makefile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
APP=gitls
2+
FLAGS=-trimpath -ldflags="-s -w -buildid="
3+
PLATFORMS=windows linux darwin
4+
OS=$(word 1, $@)
5+
6+
all: ${PLATFORMS}
7+
8+
${PLATFORMS}:
9+
GOOS=${OS} go build ${FLAGS} -o ${APP}_${OS}
10+
11+
clean:
12+
rm ${APP}_*

go.mod

+3-16
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,8 @@ module github.com/audibleblink/git-ls
33
go 1.14
44

55
require (
6-
github.com/briandowns/spinner v1.11.1
7-
github.com/fatih/color v1.9.0 // indirect
8-
github.com/golang/protobuf v1.4.2 // indirect
9-
github.com/google/go-github/v32 v32.0.0
10-
github.com/kr/pretty v0.2.0 // indirect
11-
github.com/mattn/go-colorable v0.1.6 // indirect
12-
github.com/pkg/errors v0.9.1 // indirect
13-
github.com/sergi/go-diff v1.1.0 // indirect
14-
github.com/stretchr/testify v1.5.1 // indirect
15-
golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 // indirect
16-
golang.org/x/net v0.0.0-20200602114024-627f9648deb9 // indirect
17-
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
18-
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 // indirect
19-
google.golang.org/appengine v1.6.6 // indirect
20-
google.golang.org/protobuf v1.24.0 // indirect
6+
github.com/briandowns/spinner v1.6.1
7+
github.com/google/go-github/v32 v32.1.0
8+
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
219
gopkg.in/src-d/go-git.v4 v4.13.1
22-
gopkg.in/yaml.v2 v2.2.8 // indirect
2310
)

0 commit comments

Comments
 (0)