-
Notifications
You must be signed in to change notification settings - Fork 19
84 lines (82 loc) · 3.82 KB
/
release-binary.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
76
77
78
79
80
81
82
83
84
name: Release Binaries
on:
workflow_dispatch:
push:
tags:
- 'v*.*.*'
- 'v*.*.*-*'
jobs:
build:
name: Build and Upload Release Assets
runs-on: ubuntu-latest
container: golang:1.22-bullseye
steps:
- name: Checkout code
uses: actions/checkout@v2
# workaround for issue: https://github.com/docker-library/golang/issues/452#issuecomment-1418939909
- name: Set workspace as safe
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Build Linux/amd64 binary
run: |
export GO111MODULE=on
export CGO_ENABLED=0
export GOOS=linux
export GOARCH=amd64
go build -o zdm-proxy-${{ github.ref_name }} ./proxy
tar cvfz zdm-proxy-linux-amd64-${{ github.ref_name }}.tgz zdm-proxy-${{ github.ref_name }} LICENSE
- name: Build Windows/amd64 binary
run: |
apt update
apt -y install zip
export GO111MODULE=on
export CGO_ENABLED=0
export GOOS=windows
export GOARCH=amd64
go build -o zdm-proxy-${{ github.ref_name }}.exe ./proxy
zip -vr zdm-proxy-windows-amd64-${{ github.ref_name }}.zip zdm-proxy-${{ github.ref_name }}.exe LICENSE
- name: Build Darwin/amd64 binary
run: |
export GO111MODULE=on
export CGO_ENABLED=0
export GOOS=darwin
export GOARCH=amd64
go build -o zdm-proxy-${{ github.ref_name }} ./proxy
tar cvfz zdm-proxy-darwin-amd64-${{ github.ref_name }}.tgz zdm-proxy-${{ github.ref_name }} LICENSE
- name: Build Darwin/arm64 binary
run: |
export GO111MODULE=on
export CGO_ENABLED=0
export GOOS=darwin
export GOARCH=arm64
go build -o zdm-proxy-${{ github.ref_name }} ./proxy
tar cvfz zdm-proxy-darwin-arm64-${{ github.ref_name }}.tgz zdm-proxy-${{ github.ref_name }} LICENSE
- name: Build Linux/arm64 binary
run: |
export GO111MODULE=on
export CGO_ENABLED=0
export GOOS=linux
export GOARCH=arm64
go build -o zdm-proxy-${{ github.ref_name }} ./proxy
tar cvfz zdm-proxy-linux-arm64-${{ github.ref_name }}.tgz zdm-proxy-${{ github.ref_name }} LICENSE
- name: Generate Checksums
run: |
sha256sum zdm-proxy-linux-amd64-${{ github.ref_name }}.tgz | cut -d ' ' -f 1 > zdm-proxy-linux-amd64-${{ github.ref_name }}-sha256.txt
sha256sum zdm-proxy-windows-amd64-${{ github.ref_name }}.zip | cut -d ' ' -f 1 > zdm-proxy-windows-amd64-${{ github.ref_name }}-sha256.txt
sha256sum zdm-proxy-darwin-amd64-${{ github.ref_name }}.tgz | cut -d ' ' -f 1 > zdm-proxy-darwin-amd64-${{ github.ref_name }}-sha256.txt
sha256sum zdm-proxy-darwin-arm64-${{ github.ref_name }}.tgz | cut -d ' ' -f 1 > zdm-proxy-darwin-arm64-${{ github.ref_name }}-sha256.txt
sha256sum zdm-proxy-linux-arm64-${{ github.ref_name }}.tgz | cut -d ' ' -f 1 > zdm-proxy-linux-arm64-${{ github.ref_name }}-sha256.txt
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: ZDM Proxy ${{ github.ref_name }}
files: |
zdm-proxy-linux-amd64-${{ github.ref_name }}.tgz
zdm-proxy-linux-amd64-${{ github.ref_name }}-sha256.txt
zdm-proxy-windows-amd64-${{ github.ref_name }}.zip
zdm-proxy-windows-amd64-${{ github.ref_name }}-sha256.txt
zdm-proxy-darwin-amd64-${{ github.ref_name }}.tgz
zdm-proxy-darwin-amd64-${{ github.ref_name }}-sha256.txt
zdm-proxy-darwin-arm64-${{ github.ref_name }}.tgz
zdm-proxy-darwin-arm64-${{ github.ref_name }}-sha256.txt
zdm-proxy-linux-arm64-${{ github.ref_name }}.tgz
zdm-proxy-linux-arm64-${{ github.ref_name }}-sha256.txt