Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit f6326a1

Browse files
committed
create release.yml
1 parent d7f1e78 commit f6326a1

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

.github/workflows/release.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
push:
3+
# Sequence of patterns matched against refs/tags
4+
tags:
5+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
6+
7+
name: Upload Release Asset
8+
9+
jobs:
10+
build:
11+
name: Upload Release Asset
12+
runs-on: ubuntu-latest
13+
steps:
14+
15+
- name: Set up Go 1.x
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: ^1.13
19+
id: go
20+
21+
- name: Checkout code
22+
uses: actions/checkout@v2
23+
24+
- name: Build project # This would actually build your project, using zip for an example artifact
25+
run: |
26+
go get -v -t -d ./...
27+
sh ./build.sh
28+
29+
- name: Create Release
30+
id: create_release
31+
uses: actions/create-release@v1
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
tag_name: ${{ github.ref }}
36+
release_name: Release ${{ github.ref }}
37+
draft: false
38+
prerelease: false
39+
40+
- name: Upload Release Asset
41+
id: upload-release-asset
42+
uses: actions/upload-release-asset@v1
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
with:
46+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
47+
asset_path: ./Robot_Monitor_Web_linux.zip
48+
asset_name: Robot_Monitor_Web_linux.zip
49+
asset_content_type: application/zip

build.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ go get github.com/go-bindata/go-bindata/...
88
go get github.com/elazarl/go-bindata-assetfs/...
99
go-bindata -fs -prefix "WebPageBuild/" WebPageBuild/
1010
go-bindata-assetfs WebPageBuild/...
11-
go build
11+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o Robot_Monitor_Web_linux
12+
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -v -o Robot_Monitor_Web_mac
13+
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -v -o Robot_Monitor_Web_windows.exe
14+
zip Robot_Monitor_Web_linux.zip Robot_Monitor_Web_linux
15+
zip Robot_Monitor_Web_mac.zip Robot_Monitor_Web_mac
16+
zip Robot_Monitor_Web_windows.zip Robot_Monitor_Web_windows.exe
1217
rm -f main.go
1318
mv main.go.org main.go
1419
#rm -rf WebPageBuild

0 commit comments

Comments
 (0)