-
Notifications
You must be signed in to change notification settings - Fork 71
111 lines (100 loc) · 4.04 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
on:
push:
tags:
- "v*"
name: Create Release
jobs:
create_release:
runs-on: ubuntu-latest
env:
ASSET_FILES: LICENSE README.md access_point_config.tar.gz fix_avatar_colors_for_overlay font schedules static
switch_config.txt templates tunnel
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.22.x
- name: Check out code
uses: actions/checkout@v2
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Cheesy Arena ${{ github.ref }}
body: This is a release of Cheesy Arena for the 2024 FRC game, CRESCENDO. Download the version for your
operating system below. Supported operating systems are Linux, macOS (x64 and M1), and Windows.
draft: false
prerelease: false
- name: Set additional environment variables
run: |
echo "LINUX_X64_FILENAME=cheesy-arena.${GITHUB_REF:10}.linux.x64.zip" >> $GITHUB_ENV
echo "MACOS_X64_FILENAME=cheesy-arena.${GITHUB_REF:10}.macos.x64.zip" >> $GITHUB_ENV
echo "MACOS_M1_FILENAME=cheesy-arena.${GITHUB_REF:10}.macos.m1.zip" >> $GITHUB_ENV
echo "WINDOWS_X64_FILENAME=cheesy-arena.${GITHUB_REF:10}.windows.x64.zip" >> $GITHUB_ENV
- name: Build Linux bundle
run: |
rm -rf cheesy-arena*
mkdir cheesy-arena
GOOS=linux GOARCH=amd64 go build -o cheesy-arena/
cp -r ${{ env.ASSET_FILES }} cheesy-arena/
zip -r -X ${{ env.LINUX_X64_FILENAME }} cheesy-arena
- name: Upload Linux bundle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.LINUX_X64_FILENAME }}
asset_name: ${{ env.LINUX_X64_FILENAME }}
asset_content_type: application/zip
- name: Build MacOS x64 bundle
run: |
rm -rf cheesy-arena*
mkdir cheesy-arena
GOOS=darwin GOARCH=amd64 go build -o cheesy-arena/
cp -r ${{ env.ASSET_FILES }} cheesy-arena/
zip -r -X ${{ env.MACOS_X64_FILENAME }} cheesy-arena
- name: Upload MacOS x64 bundle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.MACOS_X64_FILENAME }}
asset_name: ${{ env.MACOS_X64_FILENAME }}
asset_content_type: application/zip
- name: Build MacOS M1 bundle
run: |
rm -rf cheesy-arena*
mkdir cheesy-arena
GOOS=darwin GOARCH=arm64 go build -o cheesy-arena/
cp -r ${{ env.ASSET_FILES }} cheesy-arena/
zip -r -X ${{ env.MACOS_M1_FILENAME }} cheesy-arena
- name: Upload MacOS M1 bundle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.MACOS_M1_FILENAME }}
asset_name: ${{ env.MACOS_M1_FILENAME }}
asset_content_type: application/zip
- name: Build Windows bundle
run: |
rm -rf cheesy-arena*
mkdir cheesy-arena
GOOS=windows GOARCH=amd64 go build -o cheesy-arena/
cp -r ${{ env.ASSET_FILES }} cheesy-arena/
zip -r -X ${{ env.WINDOWS_X64_FILENAME }} cheesy-arena
- name: Upload Windows bundle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.WINDOWS_X64_FILENAME }}
asset_name: ${{ env.WINDOWS_X64_FILENAME }}
asset_content_type: application/zip