forked from laamaa/m8c
-
Notifications
You must be signed in to change notification settings - Fork 6
144 lines (129 loc) · 3.95 KB
/
build.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
name: m8c build
on:
push:
pull_request:
workflow_dispatch:
jobs:
build-win:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- { sys: mingw32, env: i686, win: win32 }
- { sys: mingw64, env: x86_64, win: win64 }
name: ${{ matrix.win }}
defaults:
run:
shell: msys2 {0}
env:
MINGW_ARCH: ${{ matrix.sys }}
steps:
- name: 'git config'
run: git config --global core.autocrlf input
shell: bash
- name: 'Checkout'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Setup MSYS2'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
update: true
install: mingw-w64-${{ matrix.env }}-toolchain make mingw-w64-${{ matrix.env }}-SDL2 mingw-w64-${{ matrix.env }}-libserialport zip dos2unix
- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: 'Build package'
run: |
make
strip -g m8c.exe
if [ ${{ matrix.win }} == "win32" ]
then
cp /mingw32/bin/SDL2.dll .
cp /mingw32/bin/libgcc_s_dw2-1.dll .
cp /mingw32/bin/libserialport-0.dll .
cp /mingw32/bin/libwinpthread-1.dll .
else
cp /mingw64/bin/SDL2.dll .
cp /mingw64/bin/libserialport-0.dll .
fi
unix2dos README.md LICENSE AUDIOGUIDE.md
- name: 'Upload artifact (win32)'
if: matrix.win == 'win32'
uses: actions/upload-artifact@v4
with:
name: m8c-${{ env.NOW }}-${{ matrix.win }}
path: |
m8c.exe
SDL2.dll
libserialport-0.dll
libgcc_s_dw2-1.dll
libwinpthread-1.dll
gamecontrollerdb.txt
LICENSE
README.md
AUDIOGUIDE.md
- name: 'Upload artifact (win64)'
if: matrix.win == 'win64'
uses: actions/upload-artifact@v4
with:
name: m8c-${{ env.NOW }}-${{ matrix.win }}
path: |
m8c.exe
SDL2.dll
libserialport-0.dll
gamecontrollerdb.txt
LICENSE
README.md
AUDIOGUIDE.md
build-linux:
runs-on: ubuntu-latest
name: linux-x86_64
steps:
- name: 'Install dependencies'
run: |
sudo apt-get update
sudo apt-get install --fix-missing build-essential libsdl2-dev libserialport-dev zip
- name: 'Checkout'
uses: actions/checkout@v4
- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: 'Build package'
run: |
make
- name: 'Upload artifact'
uses: actions/upload-artifact@v4
with:
name: m8c-${{ env.NOW }}-linux
path: |
LICENSE
README.md
AUDIOGUIDE.md
m8c
gamecontrollerdb.txt
build-macos:
runs-on: macos-latest
steps:
- name: 'Install dependencies'
run: brew install cmake sdl2 libserialport pkg-config
- name: 'Checkout'
uses: actions/checkout@v4
- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: 'Build package'
run: |
INSTALL_PREFIX=/tmp/
mkdir build && cd build
cmake ..
cmake --build .
cmake --install . --prefix=$INSTALL_PREFIX
codesign --deep --force --verify --verbose --timestamp --sign - "$INSTALL_PREFIX/m8c.app" "$INSTALL_PREFIX/m8c.app/Contents/Frameworks/libSDL2-2.0.0.dylib" "$INSTALL_PREFIX/m8c.app/Contents/Frameworks/libserialport.0.dylib"
cd ..
cp -r /tmp/m8c.app .
zip -r m8c.zip m8c.app LICENSE README.md AUDIOGUIDE.md gamecontrollerdb.txt
- name: 'Upload artifact'
uses: actions/upload-artifact@v4
with:
name: m8c-${{ env.NOW }}-macos
path: m8c.zip