Skip to content

Commit 8c75cf4

Browse files
authored
Create upload-to-release.yml
1 parent 050a360 commit 8c75cf4

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# .github/workflows/upload-to-release.yml
2+
3+
name: Go Release
4+
5+
on:
6+
release:
7+
#types: [published]
8+
types: [created]
9+
10+
11+
jobs:
12+
13+
release-matrix:
14+
#if: github.repository == 'woytu/tool-gin'
15+
name: Build with go on ubuntu-latest and upload
16+
runs-on: ubuntu-latest
17+
18+
#strategy:
19+
#matrix:
20+
#goos: [linux, windows, darwin]
21+
#goarch: ["386", amd64]
22+
23+
steps:
24+
25+
- name: Install Go
26+
uses: actions/setup-go@v2
27+
with:
28+
go-version: '^1.13.1'
29+
id: go
30+
31+
- name: Check out source code
32+
uses: actions/checkout@v2
33+
34+
- name: Get dependencies
35+
run: |
36+
go get -v -t -d ./...
37+
if [ -f Gopkg.toml ]; then
38+
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
39+
dep ensure
40+
fi
41+
- name: Build and compression
42+
run: |
43+
bash go_pack.sh
44+
- name: Upload to release
45+
uses: JasonEtco/upload-to-release@master
46+
with:
47+
args: tool-gin* application/octet-stream
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)