Skip to content

Fix Mac build, finally. #71

Fix Mac build, finally.

Fix Mac build, finally. #71

Workflow file for this run

# 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