forked from dhewm/dhewm3
-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (143 loc) · 6.12 KB
/
win_msvc.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: Testbuild for x86 and x86_64 Windows
run-name: testbuild_windows
on:
push:
branches:
- 'master'
- 'gh-build'
pull_request:
types:
- edited
- opened
- synchronize
concurrency:
# Cancel concurrent workflows for the same PR or commit hash.
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
cancel-in-progress: true
jobs:
build_win_x86_msvc:
runs-on: windows-latest
defaults:
run:
# use git bash for for all steps (unless specified otherwise per step)
shell: bash
strategy:
fail-fast: false
steps:
- name: Install build dependencies
run: |
# Download and extract dhewm3-libs
#echo $PWD # /d/a/dhewm3/dhewm3
# as the repo will be cloned into the directory we're currently in (O_o)
# go one directory up to D:\a\dhewm3\ and put the dhewm3libs there
cd ..
# https://github.com/dhewm/dhewm3-libs/archive/refs/heads/master.zip
# for some reason the following downloads an empty file, so use the other URL I got from
# "Copy Download Link" in Firefox (after downloading the file there) instead
#curl -o dhewm3libs.zip https://github.com/dhewm/dhewm3-libs/archive/refs/heads/master.zip
curl -o dhewm3libs.zip https://codeload.github.com/dhewm/dhewm3-libs/zip/refs/heads/master
# only unpack the stuff needed (no x86_64 stuff, no docs from share/)
unzip dhewm3libs.zip "dhewm3-libs-master/i686-w64-mingw32/**" -x "dhewm3-libs-master/i686-w64-mingw32/share/**"
- name: Check out repository code
uses: actions/checkout@v4
- name: Build
run: |
# build with cmake and visual studio
#echo $PWD # /d/a/dhewm3/dhewm3
# NOTE: not setting -G "Visual Studio 17 2022" so it just uses the default VS version it can find
cmake -A Win32 -DDHEWM3LIBS="../dhewm3-libs-master/i686-w64-mingw32/" -DDEDICATED=ON -DTOOLS=ON -S neo/ -B build
time cmake --build build/ --config RelWithDebInfo
- name: Create testbuild package
run: |
# Create release directory tree
export PKGDIR="dhewm3-win32-$(git rev-parse --short HEAD)"
echo "pkgname=$PKGDIR" >> $GITHUB_ENV
#echo "PKGDIR is $PKGDIR"
mkdir -p publish/$PKGDIR/base
mkdir publish/$PKGDIR/d3xp
# Copy release assets
cd build/RelWithDebInfo
cp dhewm3.exe dhewm3ded.exe base.dll d3xp.dll ../../publish/$PKGDIR/
cd ../..
# Copy misc assets
cp base/gamepad.cfg publish/$PKGDIR/base/
cp base/gamepad-d3xp.cfg publish/$PKGDIR/d3xp/
cp COPYING.txt publish/$PKGDIR/
cp README.md publish/$PKGDIR/README.txt
cp Changelog.md publish/$PKGDIR/Changelog.txt
cp Configuration.md publish/$PKGDIR/Configuration.txt
# copy runtime libraries (SDL, OpenAL, cURL)
cd ../dhewm3-libs-master/i686-w64-mingw32/bin/
cp OpenAL32.dll SDL2.dll libcurl-4.dll ../../../dhewm3/publish/$PKGDIR/
cd -
#ls -R publish/
- name: Upload testbuild package
uses: actions/upload-artifact@v4
with:
#name: "dhewm3-win32-$(git rev-parse --short HEAD)"
name: ${{ env.pkgname }}
path: publish/
if-no-files-found: error
build_win_x86_64_msvc:
runs-on: windows-latest
defaults:
run:
# use git bash for for all steps (unless specified otherwise per step)
shell: bash
strategy:
fail-fast: false
steps:
- name: Install build dependencies
run: |
# Download and extract dhewm3-libs
#echo $PWD # /d/a/dhewm3/dhewm3
# as the repo will be cloned into the directory we're currently in (O_o)
# go one directory up to D:\a\dhewm3\ and put the dhewm3libs there
cd ..
# https://github.com/dhewm/dhewm3-libs/archive/refs/heads/master.zip
# for some reason the following downloads an empty file, so use the other URL I got from
# "Copy Download Link" in Firefox (after downloading the file there) instead
#curl -o dhewm3libs.zip https://github.com/dhewm/dhewm3-libs/archive/refs/heads/master.zip
curl -o dhewm3libs.zip https://codeload.github.com/dhewm/dhewm3-libs/zip/refs/heads/master
# only unpack the stuff needed (no i686 stuff, no docs from share/)
unzip dhewm3libs.zip "dhewm3-libs-master/x86_64-w64-mingw32/**" -x "dhewm3-libs-master/x86_64-w64-mingw32/share/**"
- name: Check out repository code
uses: actions/checkout@v4
- name: Build
run: |
# build with cmake and visual studio
#echo $PWD # /d/a/dhewm3/dhewm3
# NOTE: not setting -G "Visual Studio 17 2022" so it just uses the default VS version it can find
cmake -A x64 -DDHEWM3LIBS="../dhewm3-libs-master/x86_64-w64-mingw32/" -DDEDICATED=ON -DTOOLS=ON -S neo/ -B build
time cmake --build build/ --config RelWithDebInfo
- name: Create testbuild package
run: |
# Create release directory tree
export PKGDIR="dhewm3-win64-$(git rev-parse --short HEAD)"
echo "pkgname=$PKGDIR" >> $GITHUB_ENV
#echo "PKGDIR is $PKGDIR"
mkdir -p publish/$PKGDIR/base
mkdir publish/$PKGDIR/d3xp
# Copy release assets
cd build/RelWithDebInfo
cp dhewm3.exe dhewm3ded.exe base.dll d3xp.dll ../../publish/$PKGDIR/
cd ../..
# Copy misc assets
cp base/gamepad.cfg publish/$PKGDIR/base/
cp base/gamepad-d3xp.cfg publish/$PKGDIR/d3xp/
cp COPYING.txt publish/$PKGDIR/
cp README.md publish/$PKGDIR/README.txt
cp Changelog.md publish/$PKGDIR/Changelog.txt
cp Configuration.md publish/$PKGDIR/Configuration.txt
# copy runtime libraries (SDL, OpenAL, cURL)
cd ../dhewm3-libs-master/x86_64-w64-mingw32/bin/
cp OpenAL32.dll SDL2.dll libcurl-4.dll ../../../dhewm3/publish/$PKGDIR/
cd -
#ls -R publish/
- name: Upload testbuild package
uses: actions/upload-artifact@v4
with:
#name: "dhewm3-win64-$(git rev-parse --short HEAD)"
name: ${{ env.pkgname }}
path: publish/
if-no-files-found: error