forked from TheAssemblyArmada/Vanilla-Conquer
-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (124 loc) · 6.88 KB
/
mingw.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
140
141
142
143
name: mingw-w64
on:
pull_request:
push:
jobs:
remaster_gcc:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
with:
submodules: 'true'
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Set Git Info
id: gitinfo
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Install Dependencies
run: |
sudo apt-get update -qq > /dev/null
sudo apt-get install -qq -y mingw-w64 > /dev/null
- name: Configure Vanilla Conquer
run: |
cmake -DCMAKE_TOOLCHAIN_FILE=cmake/i686-mingw-w64-toolchain.cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_REMASTERTD=ON -DBUILD_REMASTERRA=ON -DBUILD_VANILLATD=OFF -DBUILD_VANILLARA=OFF -DNETWORKING=OFF -B build
- name: Build Vanilla Conquer
run: |
cmake --build build -- -j 4
cp ./build/TiberianDawn.dll ./build/TiberianDawn.dbg
cp ./build/RedAlert.dll ./build/RedAlert.dbg
i686-w64-mingw32-strip --strip-all ./build/TiberianDawn.dll
i686-w64-mingw32-strip --strip-all ./build/RedAlert.dll
i686-w64-mingw32-objcopy --add-gnu-debuglink=./build/TiberianDawn.dbg ./build/TiberianDawn.dll
i686-w64-mingw32-objcopy --add-gnu-debuglink=./build/RedAlert.dbg ./build/RedAlert.dll
cp -f ./build/TiberianDawn.dll ./build/Vanilla_TD/Data/
cp -f ./build/RedAlert.dll ./build/Vanilla_RA/Data/
- name: Create archives
run: |
mkdir artifact
7z a artifact/vanilla-conquer-remasterdll-gcc-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/TiberianDawn.dll ./build/RedAlert.dll
7z a artifact/vanilla-conquer-remasterdll-gcc-${{ steps.gitinfo.outputs.sha_short }}-debug.zip ./build/TiberianDawn.dbg ./build/RedAlert.dbg
7z a artifact/vanilla-ra-remaster-mod-gcc-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/Vanilla_RA
7z a artifact/vanilla-td-remaster-mod-gcc-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/Vanilla_TD
- name: Upload artifact
uses: actions/[email protected]
with:
name: vanilla-conquer-remaster-gcc
path: artifact
vanilla_win_gcc:
runs-on: ubuntu-22.04
strategy:
matrix:
platform: [x86, amd64]
steps:
- uses: actions/[email protected]
with:
submodules: 'true'
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Set Git Info
id: gitinfo
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Set variables
id: vars
run: |
if [ "${{ matrix.platform }}" = "x86" ]
then
echo "oal_path=Win32" >> $GITHUB_OUTPUT
echo "arc_path=i686" >> $GITHUB_OUTPUT
else
echo "oal_path=Win64" >> $GITHUB_OUTPUT
echo "arc_path=x86_64" >> $GITHUB_OUTPUT
fi
- name: Install Dependencies
run: |
sudo apt-get update -qq > /dev/null
sudo apt-get install -qq -y mingw-w64 imagemagick > /dev/null
wget -q https://www.libsdl.org/release/SDL2-devel-2.0.12-mingw.tar.gz
wget -q https://www.openal-soft.org/openal-binaries/openal-soft-1.21.0-bin.zip
tar -xf SDL2-devel-2.0.12-mingw.tar.gz -C /tmp
unzip -qq openal-soft-1.21.0-bin.zip -d /tmp
mv /tmp/openal-soft-1.21.0-bin/bin/${{ steps.vars.outputs.oal_path }}/soft_oal.dll /tmp/openal-soft-1.21.0-bin/bin/${{ steps.vars.outputs.oal_path }}/OpenAL32.dll
- name: Configure Vanilla Conquer
run: |
cmake -DCMAKE_TOOLCHAIN_FILE=cmake/${{ steps.vars.outputs.arc_path }}-mingw-w64-toolchain.cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSDL2=ON -DSDL2_ROOT_DIR=/tmp/SDL2-2.0.12 -DSDL2_INCLUDE_DIR=/tmp/SDL2-2.0.12/${{ steps.vars.outputs.arc_path }}-w64-mingw32/include/SDL2 -DSDL2_LIBRARY=/tmp/SDL2-2.0.12/${{ steps.vars.outputs.arc_path }}-w64-mingw32/lib/libSDL2.dll.a -DSDL2_SDLMAIN_LIBRARY=/tmp/SDL2-2.0.12/${{ steps.vars.outputs.arc_path }}-w64-mingw32/lib/libSDL2main.a -DSDL2_RUNTIME_LIBRARY=/tmp/SDL2-2.0.12/${{ steps.vars.outputs.arc_path }}-w64-mingw32/bin/SDL2.dll -DOPENAL=ON -DOPENAL_ROOT=/tmp/openal-soft-1.21.0-bin -DOPENAL_INCLUDE_DIR=/tmp/openal-soft-1.21.0-bin/include/AL -DOPENAL_LIBRARY=/tmp/openal-soft-1.21.0-bin/libs/${{ steps.vars.outputs.oal_path }}/libOpenAL32.dll.a -DOPENAL_RUNTIME_LIBRARY=/tmp/openal-soft-1.21.0-bin/bin/${{ steps.vars.outputs.oal_path }}/OpenAL32.dll -DBUILD_TOOLS=ON -DBUILD_REMASTERTD=OFF -DBUILD_REMASTERRA=OFF -DMAP_EDITORTD=ON -DMAP_EDITORRA=ON -DImageMagick_convert_EXECUTABLE=/usr/bin/convert -DImageMagick_convert_FOUND=TRUE -B build
- name: Build Vanilla Conquer
run: |
cmake --build build -- -j 4
cp ./build/vanillatd.exe ./build/vanillatd.dbg
cp ./build/vanillara.exe ./build/vanillara.dbg
cp ./build/vanillamix.exe ./build/vanillamix.dbg
${{ steps.vars.outputs.arc_path }}-w64-mingw32-strip --strip-all ./build/vanillatd.exe
${{ steps.vars.outputs.arc_path }}-w64-mingw32-strip --strip-all ./build/vanillara.exe
${{ steps.vars.outputs.arc_path }}-w64-mingw32-strip --strip-all ./build/vanillamix.exe
${{ steps.vars.outputs.arc_path }}-w64-mingw32-objcopy --add-gnu-debuglink=./build/vanillatd.dbg ./build/vanillatd.exe
${{ steps.vars.outputs.arc_path }}-w64-mingw32-objcopy --add-gnu-debuglink=./build/vanillara.dbg ./build/vanillara.exe
${{ steps.vars.outputs.arc_path }}-w64-mingw32-objcopy --add-gnu-debuglink=./build/vanillamix.dbg ./build/vanillamix.exe
- name: Create archives
run: |
mkdir artifact
7z a artifact/vanilla-conquer-win-gcc-${{ steps.vars.outputs.arc_path }}-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/vanillatd.exe ./build/vanillara.exe ./build/vanillamix.exe /tmp/SDL2-2.0.12/${{ steps.vars.outputs.arc_path }}-w64-mingw32/bin/SDL2.dll /tmp/openal-soft-1.21.0-bin/bin/${{ steps.vars.outputs.oal_path }}/OpenAL32.dll
7z a artifact/vanilla-conquer-win-gcc-${{ steps.vars.outputs.arc_path }}-${{ steps.gitinfo.outputs.sha_short }}-debug.zip ./build/vanillatd.dbg ./build/vanillara.dbg ./build/vanillamix.dbg
- name: Upload artifact
uses: actions/[email protected]
with:
name: vanilla-conquer-win-gcc-${{ steps.vars.outputs.arc_path }}
path: artifact
- name: Upload development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' }}
uses: softprops/action-gh-release@v1
with:
name: Development Build
tag_name: "latest"
prerelease: true
files: |
artifact/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload tagged release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: softprops/action-gh-release@v1
with:
files: |
artifact/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}