Skip to content

Commit b96105e

Browse files
committed
add github actions
1 parent 6be2c5d commit b96105e

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

.github/workflows/go-continuous.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Continuous Releases
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
9+
build:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
steps:
13+
14+
- name: Set up Go 1.x
15+
uses: actions/setup-go@v2
16+
with:
17+
go-version: ^1.13
18+
id: go
19+
20+
- name: Check out code into the Go module directory
21+
uses: actions/checkout@v2
22+
23+
- name: Get dependencies
24+
run: |
25+
go get -v -t -d ./...
26+
if [ -f Gopkg.toml ]; then
27+
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
28+
dep ensure
29+
fi
30+
31+
- name: Build
32+
run: go build -o ./dist/app -v ./app
33+
34+
- name: Update Release
35+
uses: johnwbyrd/update-release@v1.0.0
36+
with:
37+
# Your Github token; try \$\{\{ secrets.GITHUB_TOKEN \}\} if your build lasts less than an hour, or create your own secret token with repository access if your build requires longer than an hour.
38+
token: ${{ secrets.GITHUB_TOKEN }}
39+
# Paths to built files to be released. May be absolute or relative to \$\{\{ github.workspace \}\}.
40+
files: ./dist/app
41+
# The name of the release to be created. A reasonable looking release name will be created from the current \$\{\{ github.ref \}\} if this input is not supplied.
42+
release: continuous
43+
message: # optional
44+
# Should the release, if created, be marked as a prerelease? Such releases are generally publicly visible.
45+
prerelease: # optional, default is true

.github/workflows/go.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
11+
build:
12+
name: Build
13+
runs-on: ubuntu-latest
14+
steps:
15+
16+
- name: Set up Go 1.x
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: ^1.13
20+
id: go
21+
22+
- name: Check out code into the Go module directory
23+
uses: actions/checkout@v2
24+
25+
- name: Get dependencies
26+
run: |
27+
go get -v -t -d ./...
28+
if [ -f Gopkg.toml ]; then
29+
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
30+
dep ensure
31+
fi
32+
33+
- name: Build
34+
run: go build -o ./dist/app -v ./app
35+
36+
- name: Upload a Build Artifact
37+
uses: actions/upload-artifact@v2
38+
with:
39+
path: ./dist/app

0 commit comments

Comments
 (0)