forked from mamedev/mame
-
Notifications
You must be signed in to change notification settings - Fork 24
172 lines (165 loc) · 6.63 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
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
# This is a basic workflow that is manually triggered
name: Build GroovyMAME on a new tag
# Only build when a tag looks like gm0???sr????
# It will, in the end, converted to the GM version + SR version
# eg: gm0223sr017q
on:
push:
tags:
- gm0*sr*
jobs:
# GM build jobs : on linux/mingw (corssbuild for windows), on windows/msys2 and linux
# mingw-windows-build:
# Cross ompilation job, runs on a Ubuntu Linux runner and builds windows binaries
# Disabled for now because of https://github.com/mamedev/mame/issues/7240
# Take care if you enable this job again, others must have changed since
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Setup environment
# run: |
# sudo apt update
# sudo apt-get install mingw-w64 wine64 p7zip
# sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
# - name: Build GroovyMAME
# run: |
# make -j$(nproc) TARGET=mame TOOLS=1 SEPARATE_BIN=1 PTR64=1 OPTIMIZE=3 SYMBOLS=0 SYMLEVEL=1 REGENIE=1 TARGETOS=windows OVERRIDE_CC=x86_64-w64-mingw32-gcc OVERRIDE_CXX=x86_64-w64-mingw32-g++ OVERRIDE_LD=x86_64-w64-mingw32-ld MINGW64=/usr
# make -f dist.mak PTR64=1 TARGETOS=windows
# - name: Create MAME basic configuration
# run: |
# cd build/release/x64/Release/mame
# wine64 mame64.exe -createconfig
# - name: Create Release Asset
# run: |
# cd build/release/x64/Release/mame
# 7z a groovymame-mingw-win32-64bits.7z *
# - name: Upload artifact
# uses: actions/upload-artifact@v2
# with:
# name: binaries-win32-mingw
# path: build/release/x64/Release/mame/groovymame-mingw-win32-64bits.7z
msys-windows-build:
# Windows build in a MSYS2 environment on a Windows runner
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
update: true
install: |
git make mingw-w64-x86_64-gcc mingw-w64-x86_64-python mingw-w64-x86_64-lld mingw-w64-x86_64-libc++ p7zip
mingw-w64-x86_64-librsvg mingw-w64-x86_64-python-sphinx mingw-w64-x86_64-python-sphinxcontrib-svg2pdfconverter
mingw-w64-x86_64-texlive-fonts-recommended mingw-w64-x86_64-texlive-latex-extra mingw-w64-x86_64-llvm
- uses: actions/checkout@v2
- name: Build GroovyMAME
run: |
export MINGW64=/mingw64
export MINGW32=
export ARCHOPTS=-fuse-ld=lld
export OVERRIDE_AR=llvm-ar
make -j$(nproc) TARGET=mame TOOLS=1 SEPARATE_BIN=1 PTR64=1 OPTIMIZE=3 SYMBOLS=0 SYMLEVEL=1 REGENIE=1
make -f dist.mak PTR64=1
cp -rf artwork bgfx hlsl plugins samples build/release/x64/Release/mame/
- name: Create MAME basic configuration
run: |
cd build/release/x64/Release/mame
./mame.exe -createconfig
- name: Create Release Asset
run: |
tag="${GITHUB_REF#refs/*/}"
# Now tag should be in the shape of gm0XXXsrYYYY, ex: gm0223sr017q
mamev="${tag:3:3}"
srv="${tag: -4}"
cd build/release/x64/Release
mv mame "groovymame_0${mamev}.${srv}_win-7-8-10"
7z a "groovymame_0${mamev}.${srv}_win-7-8-10.7z" "groovymame_0${mamev}.${srv}_win-7-8-10"
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: binaries-win32-msys
path: build/release/x64/Release/groovymame*.7z
linux-build:
# Simple linux build on ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup environment
run: |
sudo apt update
sudo apt-get install git build-essential python3 libsdl2-dev libsdl2-ttf-dev libfontconfig-dev libdrm-dev p7zip
sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
sudo apt-get install -y librsvg2-bin latexmk python3-pip python3-sphinx texlive texlive-formats-extra texlive-science
pip3 install sphinxcontrib-svg2pdfconverter
- name: Build GroovyMAME
run: |
make -j$(nproc) TARGET=mame TOOLS=1 SEPARATE_BIN=1 PTR64=1 OPTIMIZE=3 SYMBOLS=0 SYMLEVEL=1 REGENIE=1
make -f dist.mak PTR64=1
- name: Create Release Asset
run: |
tag="${GITHUB_REF#refs/*/}"
# Now tag should be in the shape of gm0XXXsrYYYY, ex: gm0223sr017q
mamev="${tag:3:3}"
srv="${tag: -4}"
cd build/release/x64/Release/mame
mv mame groovymame
tar cvjf "groovymame_0${mamev}.${srv}_linux.tar.bz2" groovymame
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: binaries-linux-gcc
path: build/release/x64/Release/mame/groovymame*.tar.bz2
make_patch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Generate patch
run: |
tag="${GITHUB_REF#refs/*/}"
mamev="${tag:3:3}"
git diff mame0${mamev}..HEAD > GroovyMAME${mamev}.patch
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: GroovyMAME-patch
path: GroovyMAME*.patch
release:
runs-on: ubuntu-latest
#needs: [mingw-windows-build, msys-windows-build, linux-build]
needs: [msys-windows-build, linux-build, make_patch]
steps:
- name: Prepare data
id: prepare_data
run: |
tag="${GITHUB_REF#refs/*/}"
# Now tag should be in the shape of gm0XXXsrYYYY, ex: gm0223sr017q
mamev="${tag:3:3}"
srv="${tag: -4}"
echo "GroovyMAME: 0.$mamev"
echo "Switchres : 2.$srv"
echo "::set-output name=mame_version::${mamev}"
echo "::set-output name=switchres_version::${srv}"
echo "::set-output name=current_tag::${tag}"
- name: Download Artifacts
uses: actions/[email protected]
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAME_VERSION: ${{ steps.prepare_data.outputs.mame_version }}
SWITCHRES_VERSION: ${{ steps.prepare_data.outputs.switchres_version }}
CURRENT_TAG: ${{ steps.prepare_data.outputs.current_tag }}
with:
name: GroovyMAME 0.${{ steps.prepare_data.outputs.mame_version }} - Switchres 2.${{ steps.prepare_data.outputs.switchres_version }}
draft: true
prerelease: false
files: |
./binaries-win32-msys/groovymame_*.7z
./binaries-linux-gcc/groovymame_*.tar.bz2
./GroovyMAME-patch/GroovyMAME*.patch
# ./binaries-win32-mingw/groovymame-mingw-win32-64bits.7z