-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (44 loc) · 1.47 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: release
on:
push:
paths:
- "**"
jobs:
release:
name: k8stream
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.13"
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Run tests
run: go test -v ./...
- name: Build k8stream for linux x86_64
run: env GOOS=linux GARCH=amd64 CGO_ENABLED=0 go build -o k8stream_linux_x86_64 -installsuffix cgo github.com/last9/k8stream/
- name: Get the release tag
if: github.ref == 'refs/heads/master'
run: echo "::set-env name=VERSION::$(./k8stream_linux_x86_64 --version > version 2>&1 && cat version)"
- name: Create release for linux_x86_64
if: github.ref == 'refs/heads/master'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: k8stream_linux_x86_64
draft: false
prerelease: false
- name: Upload release asset for linux_x86_64
if: github.ref == 'refs/heads/master'
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./k8stream_linux_x86_64
asset_name: k8stream_linux_x86_64
asset_content_type: application/octet-stream