-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (67 loc) · 2.23 KB
/
make-release.yml
File metadata and controls
69 lines (67 loc) · 2.23 KB
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
name: Make a release
on:
push:
tags:
- v*.*.*
jobs:
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:
GOOS:
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: 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: kiebitz-${{matrix.arch}}
path: |
/tmp/go/bin/*
- name: Upload binaries (all other)
if: ${{ matrix.arch != 'linux_amd64' }}
uses: actions/upload-artifact@v2
with:
name: kiebitz-${{matrix.arch}}
path: |
/tmp/go/bin/${{matrix.arch}}/*
- name: rename binaries for Mac platforms
if: ${{ matrix.arch != 'linux_amd64' && matrix.arch != 'windows_amd64' }}
run: |
mv /tmp/go/bin/${{matrix.arch}}/kiebitz /tmp/go/bin/${{matrix.arch}}/kiebitz-${{matrix.arch}}
- name: rename binaries for Linux platforms
if: ${{ matrix.arch == 'linux_amd64' }}
run: |
mkdir -p /tmp/go/bin/${{matrix.arch}}
mv /tmp/go/bin/kiebitz /tmp/go/bin/${{matrix.arch}}/kiebitz-${{matrix.arch}}
- name: rename binaries for Windows platforms
if: ${{ matrix.arch == 'windows_amd64' }}
run: |
mv /tmp/go/bin/${{matrix.arch}}/kiebitz.exe /tmp/go/bin/${{matrix.arch}}/kiebitz-${{matrix.arch}}.exe
- name: Upload binaries to release page
uses: softprops/action-gh-release@v1
with:
files: |
/tmp/go/bin/*/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}