-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (73 loc) · 2.71 KB
/
make-release.yml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Make a release
on:
push:
tags:
- v*.*.*
jobs:
test_and_build:
strategy:
matrix:
go-version: [1.16.x]
arch: [linux_amd64, windows_amd64, darwin_amd64, darwin_arm64]
runs-on: ubuntu-latest
env:
GOPATH: /tmp/go
GOARCH:
steps:
- name: create Go path
run: |
mkdir -p /tmp/go
- name: install Golang
uses: actions/setup-go@v2
with:
go-version: ${{matrix.go-version}}
- name: Checkout repository
uses: actions/checkout@v2
- name: Extract version
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: run tests
if: ${{ matrix.arch == 'linux-amd64' }} # we only run the tests on Linux
run: |
export GOARCH=`echo ${{matrix.arch}} | sed 's/[a-z0-9]*_//g'`
export GOOS=`echo ${{matrix.arch}} | sed 's/\([a-z0-9]*\)_[a-z0-9]*$/\1/g'`
make certs
make test
- name: build binaries
run: |
export GOARCH=`echo ${{matrix.arch}} | sed 's/[a-z0-9]*_//g'`
export GOOS=`echo ${{matrix.arch}} | sed 's/\([a-z0-9]*\)_[a-z0-9]*$/\1/g'`
make
- name: Upload binaries (Linux)
if: ${{ matrix.arch == 'linux_amd64' }}
uses: actions/upload-artifact@v2
with:
name: eps-${{matrix.arch}}
path: |
/tmp/go/bin/*
- name: Upload binaries (all other)
if: ${{ matrix.arch != 'linux_amd64' }}
uses: actions/upload-artifact@v2
with:
name: eps-${{matrix.arch}}
path: |
/tmp/go/bin/${{matrix.arch}}/*
- name: rename binaries for non-Linux platforms
if: ${{ matrix.arch != 'linux_amd64' && matrix.arch != 'windows_amd64' }}
run: |
mv /tmp/go/bin/${{matrix.arch}}/eps /tmp/go/bin/${{matrix.arch}}/eps-${{matrix.arch}}
mv /tmp/go/bin/${{matrix.arch}}/sd /tmp/go/bin/${{matrix.arch}}/sd-${{matrix.arch}}
mv /tmp/go/bin/${{matrix.arch}}/proxy /tmp/go/bin/${{matrix.arch}}/proxy-${{matrix.arch}}
- name: rename binaries for non-Linux platforms
if: ${{ matrix.arch == 'windows_amd64' }}
run: |
mv /tmp/go/bin/${{matrix.arch}}/eps.exe /tmp/go/bin/${{matrix.arch}}/eps-${{matrix.arch}}.exe
mv /tmp/go/bin/${{matrix.arch}}/sd.exe /tmp/go/bin/${{matrix.arch}}/sd-${{matrix.arch}}.exe
mv /tmp/go/bin/${{matrix.arch}}/proxy.exe /tmp/go/bin/${{matrix.arch}}/proxy-${{matrix.arch}}.exe
- name: Upload binaries to release page
uses: softprops/action-gh-release@v1
with:
files: |
/tmp/go/bin/*/*
/tmp/go/bin/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}