-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (112 loc) · 5.23 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
133
134
135
136
137
138
139
name: Build release
on: [workflow_dispatch]
concurrency:
group: ${{ github.ref }}-release
cancel-in-progress: true
jobs:
build:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# - name: Retrieve supporting files
# run: |
# wget https://raw.githubusercontent.com/ClassiCube/MCGalaxy/master/sqlite3_x32.dll
# wget https://raw.githubusercontent.com/ClassiCube/MCGalaxy/master/sqlite3_x64.dll
# wget https://raw.githubusercontent.com/ClassiCube/MCGalaxy/master/MySql.Data.dll
#
- name: Retrieve .NET 2.0 binaries
run: |
mkdir mcg-net20
wget https://cdn.classicube.net/client/mcg/latest/net20/MCGalaxy_.dll -O mcg-net20/MCGalaxy_.dll
wget https://cdn.classicube.net/client/mcg/latest/net20/MCGalaxyCLI.exe -O mcg-net20/MCGalaxyCLI.exe
wget https://cdn.classicube.net/client/mcg/latest/net20/MCGalaxy.exe -O mcg-net20/MCGalaxy.exe
- name: Retrieve .NET 4.0 binaries
run: |
mkdir mcg-net40
wget https://cdn.classicube.net/client/mcg/latest/net40/MCGalaxy_.dll -O mcg-net40/MCGalaxy_.dll
wget https://cdn.classicube.net/client/mcg/latest/net40/MCGalaxyCLI.exe -O mcg-net40/MCGalaxyCLI.exe
wget https://cdn.classicube.net/client/mcg/latest/net40/MCGalaxy.exe -O mcg-net40/MCGalaxy.exe
- name: Retrieve .NET 4.0 (768 blocks) binaries
run: |
mkdir mcg-infid
wget https://cdn.classicube.net/client/mcg/latest/net40/MCGalaxy_infid.dll -O mcg-infid/MCGalaxy_.dll
wget https://cdn.classicube.net/client/mcg/latest/net40/MCGalaxyCLI.exe -O mcg-infid/MCGalaxyCLI.exe
wget https://cdn.classicube.net/client/mcg/latest/net40/MCGalaxy.exe -O mcg-infid/MCGalaxy.exe
- name: Retrieve standalone binaries
run: |
wget https://cdn.classicube.net/client/mcg/latest/win64 -O mcg-win64
wget https://cdn.classicube.net/client/mcg/latest/mac64 -O mcg-mac64
wget https://cdn.classicube.net/client/mcg/latest/linux64 -O mcg-linux64
- name: Generate builds
id: compile
shell: bash
run: |
mv MCGalaxy mcg_source
build_dotnet() {
mkdir $1/MCGalaxy
mv $1/MCGalaxy_.dll $1/MCGalaxy/MCGalaxy_.dll
mv $1/MCGalaxy.exe $1/MCGalaxy/MCGalaxy.exe
mv $1/MCGalaxyCLI.exe $1/MCGalaxy/MCGalaxyCLI.exe
cp sqlite3_x32.dll $1/MCGalaxy/sqlite3_x32.dll
cp sqlite3_x64.dll $1/MCGalaxy/sqlite3_x64.dll
cp MySql.Data.dll $1/MCGalaxy/MySql.Data.dll
}
make_standalone_tar() {
cp $1 MCGalaxy
chmod +x MCGalaxy
tar -zcvf $1.tar.gz MCGalaxy
}
make_standalone_zip() {
cp $1 MCGalaxy.exe
zip $1.zip MCGalaxy.exe sqlite3_x32.dll sqlite3_x64.dll
}
build_dotnet mcg-net20
build_dotnet mcg-net40
build_dotnet mcg-infid
make_standalone_zip mcg-win64
make_standalone_tar mcg-mac64
make_standalone_tar mcg-linux64
find .
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to produce release'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
# Generate .NET release files
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'mcg-net20'
DEST_NAME: 'mcg-net20'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'mcg-net40'
DEST_NAME: 'mcg-net40'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'mcg-infid'
DEST_NAME: 'mcg-infid'
# Generate standalone release files
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'mcg-win64.zip'
DEST_NAME: 'mcg-win64.zip'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'mcg-mac64.tar.gz'
DEST_NAME: 'mcg-mac64.tar.gz'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'mcg-linux64.tar.gz'
DEST_NAME: 'mcg-linux64.tar.gz'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'release'