-
Notifications
You must be signed in to change notification settings - Fork 5
132 lines (127 loc) · 4.06 KB
/
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Release
on:
release:
types: [ created ]
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: Upload binaries
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: tiny-world.tar.gz
asset_name: tiny-world-${{ env.RELEASE_VERSION }}-linux-amd64.tar.gz
tag: ${{ github.ref }}
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: |
zip -r tiny-world.zip tiny-world.exe
shell: bash
- name: Upload binaries
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: tiny-world.zip
asset_name: tiny-world-${{ env.RELEASE_VERSION }}-windows-amd64.zip
tag: ${{ github.ref }}
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: Build APP Bundle
run: |
mkdir -p tiny-world.app
cp -r .github/tiny-world.app/Contents tiny-world.app/Contents
mkdir -p tiny-world.app/Contents/MacOS
chmod u+x tiny-world
mv tiny-world tiny-world.app/Contents/MacOS/tiny-world
shell: bash
- name: Compress binaries
run: |
zip -r tiny-world.zip tiny-world.app
shell: bash
- name: Upload binaries
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: tiny-world.zip
asset_name: tiny-world-${{ env.RELEASE_VERSION }}-macos-arm64.zip
tag: ${{ github.ref }}
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: Build APP Bundle
run: |
mkdir -p tiny-world.app
cp -r .github/tiny-world.app/Contents tiny-world.app/Contents
mkdir -p tiny-world.app/Contents/MacOS
chmod u+x tiny-world
mv tiny-world tiny-world.app/Contents/MacOS/tiny-world
- name: Compress binaries
run: |
zip -r tiny-world.zip tiny-world.app
shell: bash
- name: Upload binaries
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: tiny-world.zip
asset_name: tiny-world-${{ env.RELEASE_VERSION }}-macos-amd64.zip
tag: ${{ github.ref }}