-
Notifications
You must be signed in to change notification settings - Fork 217
168 lines (160 loc) · 6.92 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
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: -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-${{ 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: -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-${{ 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-wxWidgets
mingw-w64-i686-cmake
mingw-w64-i686-libpcap
mingw-w64-i686-ninja
- name: Windows 64bits (MSYS2)
os: windows-latest
compiler: MINGW64
args: -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-${{ 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-wxWidgets
mingw-w64-x86_64-cmake
mingw-w64-x86_64-libpcap
mingw-w64-x86_64-ninja
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
steps:
- uses: actions/checkout@v2
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
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 }} *
- 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
cd temp/build
ninja install
cd $DESTDIR
tar -cjf ${{ matrix.artifacts_path }} *
- name: 'Upload GitHub Actions artifacts'
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifacts_name }}
path: ./dist/${{ matrix.artifacts_path }}
- name: Upload to NasuTek MinIO S3
uses: shallwefootball/s3-upload-action@master
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: bucketName
source_dir: ./dist
destination_dir: ${{ matrix.artifacts_name }}
endpoint: cdn.ntgecdn.com