-
Notifications
You must be signed in to change notification settings - Fork 54
169 lines (146 loc) · 6.59 KB
/
windows.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: windows
on:
pull_request:
push:
jobs:
remaster_msvc:
runs-on: windows-2019
steps:
- uses: actions/checkout@v3.3.0
with:
submodules: 'true'
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- uses: ilammy/msvc-dev-cmd@v1.12.1
with:
arch: x86
- name: Set Git Info
id: gitinfo
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Install Dependencies
run: |
Invoke-WebRequest -Uri https://github.com/ninja-build/ninja/releases/download/v1.10.1/ninja-win.zip -OutFile $Env:TEMP\ninja-win.zip
Expand-Archive $Env:TEMP\ninja-win.zip -DestinationPath $Env:TEMP\ninja
echo "$Env:TEMP\ninja" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
ninja --version
- name: Configure Vanilla Conquer
run: |
cmake -G Ninja -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 --config RelWithDebInfo
- name: Create archives
shell: bash
run: |
mkdir artifact
7z a artifact/vanilla-conquer-remasterdll-msvc-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/RedAlert.dll ./build/TiberianDawn.dll
7z a artifact/vanilla-conquer-remasterdll-msvc-${{ steps.gitinfo.outputs.sha_short }}-debug.zip ./build/RedAlert.pdb ./build/TiberianDawn.pdb
7z a artifact/vanilla-ra-remaster-mod-msvc-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/Vanilla_RA
7z a artifact/vanilla-td-remaster-mod-msvc-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/Vanilla_TD
- name: Upload artifact
uses: actions/upload-artifact@v3.1.2
with:
name: vanilla-conquer-remaster-msvc
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 }}
vanilla_win_msvc:
runs-on: windows-2019
strategy:
matrix:
platform: [x86, amd64]
steps:
- uses: actions/checkout@v3.3.0
with:
submodules: 'true'
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- uses: ilammy/msvc-dev-cmd@v1.12.1
with:
arch: ${{ matrix.platform }}
- name: Set Git Info
id: gitinfo
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Set variables
id: vars
shell: pwsh
run: |
If ("${{ matrix.platform }}" -eq "x86") {
echo "oal_path=Win32" >> $env:GITHUB_OUTPUT
echo "sdl_path=x86" >> $env:GITHUB_OUTPUT
echo "arc_path=i686" >> $env:GITHUB_OUTPUT
} else {
echo "oal_path=Win64" >> $env:GITHUB_OUTPUT
echo "sdl_path=x64" >> $env:GITHUB_OUTPUT
echo "arc_path=x86_64" >> $env:GITHUB_OUTPUT
}
- name: Install Dependencies
run: |
choco install openalsdk --no-progress
Invoke-WebRequest -Uri https://www.libsdl.org/release/SDL2-devel-2.0.12-VC.zip -OutFile $Env:TEMP\SDL2-devel.zip
Invoke-WebRequest -Uri https://github.com/ninja-build/ninja/releases/download/v1.10.1/ninja-win.zip -OutFile $Env:TEMP\ninja-win.zip
Invoke-WebRequest -SkipCertificateCheck -Uri https://www.openal-soft.org/openal-binaries/openal-soft-1.21.0-bin.zip -OutFile $Env:TEMP\openal-soft-1.21.0-bin.zip
Expand-Archive $Env:TEMP\SDL2-devel.zip -DestinationPath $Env:TEMP
Expand-Archive $Env:TEMP\ninja-win.zip -DestinationPath $Env:TEMP\ninja
Expand-Archive $Env:TEMP\openal-soft-1.21.0-bin.zip -DestinationPath $Env:TEMP
echo "$Env:TEMP\ninja" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
ninja --version
Rename-Item $Env:TEMP\openal-soft-1.21.0-bin\bin\${{ steps.vars.outputs.oal_path }}\soft_oal.dll OpenAL32.dll
- name: Configure Vanilla Conquer
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TOOLS=ON -DBUILD_TESTS=ON -DSDL2=ON "-DSDL2_ROOT_DIR=$($Env:TEMP)\SDL2-2.0.12" -DOPENAL=ON "-DOPENAL_ROOT=C:\Program Files (x86)\OpenAL 1.1 SDK" -DBUILD_REMASTERTD=OFF -DBUILD_REMASTERRA=OFF -DMAP_EDITORTD=ON -DMAP_EDITORRA=ON "-DImageMagick_magick_EXECUTABLE=$($(Get-Command magick.exe).Source)" -DImageMagick_magick_FOUND=TRUE -B build
- name: Build Vanilla Conquer
run: |
cmake --build build --config RelWithDebInfo
- name: Run unit tests
run: |
cd build
Copy-Item -Path "$Env:TEMP\SDL2-2.0.12\lib\${{ steps.vars.outputs.sdl_path }}\SDL2.dll" -Destination . -verbose
ctest -C RelWithDebInfo
- name: Create archives
shell: bash
run: |
mkdir artifact
7z a artifact/vanilla-conquer-win-msvc-${{ steps.vars.outputs.arc_path }}-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/vanillatd.exe ./build/vanillara.exe ./build/vanillamix.exe $TEMP/SDL2-2.0.12/lib/${{ steps.vars.outputs.sdl_path }}/SDL2.dll $TEMP/openal-soft-1.21.0-bin/bin/${{ steps.vars.outputs.oal_path }}/OpenAL32.dll
7z a artifact/vanilla-conquer-win-msvc-${{ steps.vars.outputs.arc_path }}-${{ steps.gitinfo.outputs.sha_short }}-debug.zip ./build/vanillatd.pdb ./build/vanillara.pdb ./build/vanillamix.pdb
- name: Upload artifact
uses: actions/upload-artifact@v3.1.2
with:
name: vanilla-conquer-win-msvc-${{ 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 }}