forked from broderickhyman/albiondata-client
-
Notifications
You must be signed in to change notification settings - Fork 1
103 lines (85 loc) · 2.3 KB
/
test-build.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# .github/workflows/test-build.yaml
on: push
jobs:
build-linux:
name: Build Linux Client
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.16
- name: Build
run: make build-linux
- uses: actions/upload-artifact@v3
if: ${{ env.ACT }}
with:
name: files
path: albiondata-client
- uses: actions/upload-artifact@v3
if: ${{ env.ACT }}
with:
name: files
path: update-linux-amd64.gz
build-windows:
name: Build Windows Client
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.16
- name: install nsis
run: sudo apt-get update; sudo apt-get -y install nsis
- name: Make
run: make build-windows
- uses: actions/upload-artifact@v3
if: ${{ env.ACT }}
with:
name: files
path: albiondata-client.exe
- uses: actions/upload-artifact@v3
if: ${{ env.ACT }}
with:
name: files
path: update-windows-amd64.exe.gz
- uses: actions/upload-artifact@v3
if: ${{ env.ACT }}
with:
name: files
path: albiondata-client-amd64-installer.exe
build-darwin:
name: Build MacOS Client
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Build
run: go build -ldflags "-s -w -X main.version=$GITHUB_REF_NAME" albiondata-client.go
- name: ls
run: ls -la
- name: gzip
run: gzip -k9 albiondata-client
- name: mv
run: mv albiondata-client.gz update-darwin-amd64.gz
- name: package
run: |
TEMP="albiondata-client"
ZIPNAME="albiondata-client-amd64-mac.zip"
rm -rfv ./scripts/$TEMP
rm -rfv ./$ZIPNAME
rm -rfv ./scripts/update-darwin-amd64.zip
mkdir -v ./scripts/$TEMP
cp -v albiondata-client ./scripts/$TEMP/albiondata-client-executable
cd scripts
cp -v run.command ./$TEMP/run.command
# chown -Rv ${USER}:${USER} ./$TEMP
chmod -v 777 ./$TEMP/*
zip -v ../$ZIPNAME -r ./"$TEMP"
- name: ls
run: ls -la