forked from sarah-walker-pcem/pcem
-
Notifications
You must be signed in to change notification settings - Fork 2
177 lines (169 loc) · 7.85 KB
/
test-debug-builds.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
170
171
172
173
174
175
176
177
name: Test Debug Builds
on:
push:
branches: [master, dev]
pull_request:
branches: [master, dev]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu 64bit (gcc)
os: ubuntu-latest
args: -DUSE_EXPERIMENTAL=ON -DUSE_EXPERIMENTAL_PRINTER=OFF -DUSE_EXPERIMENTAL_PGC=ON -DUSE_NETWORKING=OFF -DUSE_PCAP_NETWORKING=ON -DCMAKE_BUILD_TYPE=Debug -DPCEM_VERSION_STRING="vNext build ${GITHUB_SHA::8}"
artifacts_name: PCem-Debug-vNext-Ubuntu-${{ github.run_number }}
artifacts_path: PCem-Debug-vNext-Ubuntu-${{ github.run_number }}-${{ github.sha }}.tar.bz2
installdeps: >-
libsdl2-dev
libopenal-dev
libwxgtk3.0-gtk3-dev
libpcap-dev
cmake
ninja-build
- name: Windows 32bits (MSYS2)
os: windows-latest
compiler: MINGW32
args: -DUSE_EXPERIMENTAL=ON -DUSE_EXPERIMENTAL_PRINTER=OFF -DUSE_EXPERIMENTAL_PGC=ON -DUSE_NETWORKING=OFF -DUSE_PCAP_NETWORKING=OFF -DCMAKE_BUILD_TYPE=Debug -DPCEM_VERSION_STRING="vNext build ${GITHUB_SHA::8}"
artifacts_name: PCem-Debug-vNext-Windows-MINGW32-${{ github.run_number }}
artifacts_path: PCem-Debug-vNext-Windows-MINGW32-${{ github.run_number }}-${{ github.sha }}.zip
installdeps: >-
base-devel
zip
unzip
mingw-w64-i686-ntldd-git
mingw-w64-i686-toolchain
mingw-w64-i686-SDL2
mingw-w64-i686-openal
mingw-w64-i686-wxwidgets3.2-msw
mingw-w64-i686-cmake
mingw-w64-i686-ninja
- name: Windows 64bits (MSYS2)
os: windows-latest
compiler: MINGW64
args: -DUSE_EXPERIMENTAL=ON -DUSE_EXPERIMENTAL_PRINTER=OFF -DUSE_EXPERIMENTAL_PGC=ON -DUSE_NETWORKING=OFF -DUSE_PCAP_NETWORKING=ON -DCMAKE_BUILD_TYPE=Debug -DPCEM_VERSION_STRING="vNext build ${GITHUB_SHA::8}"
artifacts_name: PCem-Debug-vNext-Windows-MINGW64-${{ github.run_number }}
artifacts_path: PCem-Debug-vNext-Windows-MINGW64-${{ github.run_number }}-${{ github.sha }}.zip
installdeps: >-
base-devel
zip
unzip
mingw-w64-x86_64-ntldd-git
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-SDL2
mingw-w64-x86_64-openal
mingw-w64-x86_64-wxwidgets3.2-msw
mingw-w64-x86_64-cmake
mingw-w64-x86_64-libpcap
mingw-w64-x86_64-ninja
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
steps:
- name: "Check out repository"
uses: actions/[email protected]
with:
path: temp
fetch-depth: 0
- name: Setup MSYS2 (Windows)
if: runner.os == 'Windows'
# You may pin to the exact commit or the version.
# uses: msys2/setup-msys2@a43b8403533fffe0c157dd8498f021ddec66bff7
uses: msys2/setup-msys2@v2
with:
# Variant of the environment to set by default: MSYS, MINGW32, MINGW64, UCRT64 or CLANG64
msystem: ${{ matrix.compiler }}
# Retrieve and extract base installation from upstream GitHub Releases
release: false # optional, default is true
# Update MSYS2 installation through pacman
update: false
# Install packages after installation through pacman
install: ${{ matrix.installdeps }}
- name: Setup ubuntu dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install ${{ matrix.installdeps }}
# Copy all the sources to the dist folder, before we start generating intermediate files.
- name: prepare-package (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
mkdir dist
mkdir dist/src
cp -R ./temp/* dist/src
rm -Rf ./dist/src/.git
- name: configure (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
export INSTALL_PREFIX=$(pwd)/dist
mkdir temp/build
cd temp/build
cmake -G "Ninja" -DMSYS=TRUE -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ${{ matrix.args }} ..
- name: ninja (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
cd temp/build
ninja
- name: package (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
export INSTALL_PREFIX=$(pwd)/dist
export ARTIFACTSDIR=$(pwd)/artifacts
mkdir -p $ARTIFACTSDIR
cd temp/build
ninja install
cd $INSTALL_PREFIX
ntldd -R "bin/pcem.exe" | sed -e 's/^[[:blank:]]*//g' | cut -d ' ' -f 3 | grep -E -i '(mingw|clang)(32|64)' | sed -e 's|\\|/|g' | xargs cp --target-directory="bin"
zip -r -9 ${{ matrix.artifacts_path }} *
cp ${{ matrix.artifacts_path }} $ARTIFACTSDIR
- name: prepare-package (Linux)
if: runner.os == 'Linux'
run: |
mkdir dist
mkdir dist/src
cp -R ./temp/* dist/src
rm -Rf ./dist/src/.git
- name: configure (Linux)
if: runner.os == 'Linux'
run: |
mkdir temp/build
cd temp/build
cmake -G "Ninja" ${{ matrix.args }} ..
- name: ninja (Linux)
if: runner.os == 'Linux'
run: |
cd temp/build
ninja
- name: package (Linux)
if: runner.os == 'Linux'
run: |
export DESTDIR=$(pwd)/dist
export ARTIFACTSDIR=$(pwd)/artifacts
mkdir -p $ARTIFACTSDIR
cd temp/build
ninja install
cd $DESTDIR
tar -cjf ${{ matrix.artifacts_path }} *
cp ${{ matrix.artifacts_path }} $ARTIFACTSDIR
- name: 'Upload GitHub Actions artifacts'
uses: actions/[email protected]
with:
name: ${{ matrix.artifacts_name }}
path: ./artifacts
- name: Upload to NasuTek MinIO S3
uses: shallwefootball/s3-upload-action@master
env:
super_secret: ${{secrets.nte_cdn_s3_key_id}}
if: ${{ env.super_secret != null }}
id: S3
with:
aws_key_id: ${{secrets.nte_cdn_s3_key_id}}
aws_secret_access_key: ${{secrets.nte_cdn_s3_secret_access_key}}
aws_bucket: pcem-dev-builds
source_dir: ./artifacts
destination_dir: ''
endpoint: https://cdn.ntgecdn.com:443