CI/CD: Implement GitHub Actions and public nightly builds

This commit is contained in:
Jj0YzL5nvJ 2021-12-05 09:00:32 -07:00
parent 88093cb434
commit 51345ed0e5
2 changed files with 237 additions and 2 deletions

221
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,221 @@
name: HLE RSP
on:
push:
paths-ignore:
- '**/*.md'
- '.{gitattributes,gitignore,travis.yml}'
- 'appveyor.yml,README'
pull_request:
paths-ignore:
- '**/*.md'
- '.{gitattributes,gitignore,travis.yml}'
- 'appveyor.yml,README'
workflow_dispatch:
jobs:
Linux:
strategy:
fail-fast: false
matrix:
include:
- cc: GCC
- cc: Clang
name: Linux / ${{ matrix.cc }} / x64 | x86
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Get build dependencies and arrange the environment
run: |
sudo apt-get update
sudo apt-get --reinstall -y install gcc-multilib g++-multilib libc6 libc6-dev-i386
sudo ldconfig
- name: Build and related stuff
run: |
if [[ "${{ matrix.cc }}" == "GCC" ]]; then
CC="gcc"
CXX="g++"
else
CC="clang"
CXX="clang++"
fi
${CC} --version
echo ""
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
for BITS in 64 32
do
if [[ ${BITS} -eq 32 ]]; then MSG="x86"; else MSG="x64"; fi
echo ""
echo ":: ${{ matrix.cc }} ${MSG} ::"
echo ""
make -C projects/unix clean
echo ""
make CC="${CC}" CXX="${CXX}" BITS="${BITS}" -C projects/unix all
echo ""
ls -gG projects/unix/*.so
ldd projects/unix/mupen64plus-rsp-hle.so
done
MSYS2:
strategy:
fail-fast: false
matrix:
include:
- cc: GCC
platform: x64
cross: x86_64
bits: 64
- cc: GCC
platform: x86
cross: i686
bits: 32
name: Windows / MSYS2 ${{ matrix.cc }} / ${{ matrix.platform }}
runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW${{ matrix.bits }}
update: true
install: >-
git
make
mingw-w64-${{ matrix.cross }}-gcc
mingw-w64-${{ matrix.cross }}-toolchain
- name: Build and related stuff
run: |
export OPTFLAGS="-O2 -flto"
echo "G_REV=$(git rev-parse --short HEAD)" >> "${GITHUB_ENV}"
CC="gcc"
CXX="g++"
${CC} --version
echo ""
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
echo ""
echo ":: ${{ matrix.cc }} ${{ matrix.platform }} ::"
echo ""
make -C projects/unix clean
echo ""
make CC="${CC}" CXX="${CXX}" BITS="${{ matrix.bits }}" -C projects/unix all
echo ""
ls -gG projects/unix/*.dll
ldd projects/unix/mupen64plus-rsp-hle.dll
- name: Copy binaries, dependencies, etc...
run: |
mkdir pkg
cd projects/unix
for BIN in *.dll
do
echo ":: Copying ${BIN}"
cp "${BIN}" ../../pkg/
done
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: mupen64plus-rsp-hle-msys2-${{ matrix.platform }}-g${{ env.G_REV }}
path: pkg/*
MSVC:
strategy:
fail-fast: false
matrix:
include:
- toolset: v142
platform: x64
- toolset: v141_xp
platform: x86
name: Windows / MSVC ${{ matrix.toolset }} / ${{ matrix.platform }}
runs-on: windows-2019
defaults:
run:
shell: cmd
steps:
- uses: actions/checkout@v2
- uses: microsoft/setup-msbuild@v1.0.3
# with:
# vs-version: 16.11
- name: Build and related stuff
run: |
for /f "tokens=1" %%R in ('git rev-parse --short HEAD') do set "G_REV=%%R"
echo G_REV=%G_REV%>> "%GITHUB_ENV%"
set "ARCH=${{ matrix.platform }}"
if [%ARCH%] == [x86] set "ARCH=Win32"
echo.
msbuild --version
echo.
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ..\mupen64plus-core
echo.
msbuild projects\msvc\mupen64plus-rsp-hle.vcxproj /p:Configuration=Release;Platform=%ARCH%;PlatformToolset=${{ matrix.toolset }}
echo.
md backup
copy projects\msvc\%ARCH%\Release\mupen64plus-rsp-hle.dll backup\
dir backup\*.dll
- name: Copy binaries, dependencies, etc...
run: |
md pkg
cd pkg
xcopy "..\backup" .
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: mupen64plus-rsp-hle-msvc-${{ matrix.platform }}-g${{ env.G_REV }}
path: pkg/*
Nightly-build:
runs-on: ubuntu-latest
needs: [MSYS2, MSVC]
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: binaries
- name: Get some tools
run: |
sudo apt-get update
sudo apt-get -y install hashdeep
- name: Creating new artifacts and update nightly-build
run: |
mkdir pkg
cd binaries
for BIN in *
do
echo ":: Creating ${BIN}.zip"
cd "${BIN}"
zip -r "../../pkg/${BIN}.zip" *
cd ..
done
cd ../pkg
echo ""
for BIN in *.zip
do
ls -gG ${BIN}
tigerdeep -l ${BIN} >> ${BIN:0:19}.tiger.txt
sha256sum ${BIN} >> ${BIN:0:19}.sha256.txt
sha512sum ${BIN} >> ${BIN:0:19}.sha512.txt
done
echo ""
echo "TIGER:"
cat *.tiger.txt
echo ""
echo "SHA256:"
cat *.sha256.txt
echo ""
echo "SHA512:"
cat *.sha512.txt
echo ""
git tag -f nightly-build
git push -f origin nightly-build
- name: Nightly-build
uses: ncipollo/release-action@v1
with:
prerelease: true
allowUpdates: true
removeArtifacts: true
replacesArtifacts: false
tag: nightly-build
artifacts: pkg/*

View file

@ -167,8 +167,22 @@ ifeq ($(ARCH_DETECTED), 64BITS_32)
ifeq ($(OS), FREEBSD)
$(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386)
endif
CFLAGS += -m32
LDFLAGS += -Wl,-m,elf_i386
ifneq ($(OS), OSX)
ifeq ($(OS), MINGW)
CFLAGS += -march=i686
LDFLAGS += -Wl,-m,i386pe
else
CFLAGS += -m32
LDFLAGS += -Wl,-m,elf_i386
endif
endif
endif
ifeq ($(ARCH_DETECTED), 64BITS)
ifeq ($(OS), MINGW)
CFLAGS += -march=x86-64
LDFLAGS += -Wl,-m,i386pep
endif
endif
# set special flags per-system