-
Notifications
You must be signed in to change notification settings - Fork 5
113 lines (108 loc) · 3.06 KB
/
test-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
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
104
105
106
107
108
109
110
111
112
113
name: Test Release
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-linux:
name: Linux build
runs-on: ubuntu-latest
steps:
- name: Get tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
shell: bash
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.21.x'
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libgl1-mesa-dev xorg-dev
go get ./...
- name: Build
run: GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build .
- name: Compress binaries
run: |
tar -czf tiny-world.tar.gz tiny-world
shell: bash
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: tiny-world-linux-amd64.tar.gz
path: tiny-world.tar.gz
build-windows:
name: Windows build
runs-on: ubuntu-latest
steps:
- name: Get tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
shell: bash
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.21.x'
- name: Install dependencies
run: go get ./...
- name: Build
run: GOOS=windows GOARCH=amd64 CGO_ENABLED=1 go build .
- name: Compress binaries
run: |
tar -czf tiny-world.tar.gz tiny-world.exe
shell: bash
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: tiny-world-windows-amd64.tar.gz
path: tiny-world.tar.gz
build-macos-arm64:
name: MacOS arm64 build
runs-on: macos-latest
steps:
- name: Get tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
shell: bash
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.21.x'
- name: Build
run: GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go build .
- name: Compress binaries
run: |
tar -czf tiny-world.tar.gz tiny-world
shell: bash
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: tiny-world-macos-arm64.tar.gz
path: tiny-world.tar.gz
build-macos-amd64:
name: MacOS amd64 build
runs-on: macos-latest
steps:
- name: Get tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
shell: bash
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.21.x'
- name: Build
run: GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build .
- name: Compress binaries
run: |
tar -czf tiny-world.tar.gz tiny-world
shell: bash
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: tiny-world-macos-amd64.tar.gz
path: tiny-world.tar.gz