mirror of
https://github.com/mupen64plus/mupen64plus-video-arachnoid.git
synced 2024-06-02 19:27:49 -04:00
CI/CD: Implement GitHub Actions and public nightly builds
This commit is contained in:
parent
578edd1530
commit
3f1b81dc5a
190
.github/workflows/build.yml
vendored
Normal file
190
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,190 @@
|
|||
name: Arachnoid
|
||||
|
||||
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 dpkg --add-architecture i386
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install libgl1-mesa-dev
|
||||
sudo apt-get --reinstall -y install gcc-multilib g++-multilib libc6 libc6-dev-i386 libgl1-mesa-glx:i386
|
||||
cd /usr/lib/i386-linux-gnu
|
||||
if ! [[ -f libGL.so ]]; then sudo ln -s -T libGL.so.1.7.0 libGL.so; fi
|
||||
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
|
||||
if [[ "${CC}" == "clang" ]]; then export PIC="1"; fi
|
||||
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-video-arachnoid.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-video-arachnoid.dll
|
||||
- name: Copy binaries, dependencies, etc...
|
||||
run: |
|
||||
mkdir pkg
|
||||
if [[ ${{ matrix.bits }} -eq 32 ]]; then LIBGCC="libgcc_s_dw2-1"; else LIBGCC="libgcc_s_seh-1"; fi
|
||||
for LIB in ${LIBGCC} libstdc++-6 libwinpthread-1
|
||||
do
|
||||
echo ":: Copying ${LIB}.dll"
|
||||
cp "/mingw${{ matrix.bits }}/bin/${LIB}.dll" pkg/
|
||||
done
|
||||
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-video-arachnoid-msys2-${{ matrix.platform }}-g${{ env.G_REV }}
|
||||
path: pkg/*
|
||||
|
||||
Nightly-build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: MSYS2
|
||||
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:27}.tiger.txt
|
||||
sha256sum ${BIN} >> ${BIN:0:27}.sha256.txt
|
||||
sha512sum ${BIN} >> ${BIN:0:27}.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/*
|
|
@ -209,25 +209,35 @@ else
|
|||
endif
|
||||
endif
|
||||
|
||||
# set special flags per-system
|
||||
ifeq ($(OS), LINUX)
|
||||
# only export api symbols
|
||||
LDFLAGS += -Wl,-version-script,$(SRCDIR)/video_api_export.ver
|
||||
endif
|
||||
ifneq ($(OS), FREEBSD)
|
||||
ifeq ($(CPU), X86)
|
||||
# tweak flags for 32-bit build on 64-bit system
|
||||
ifeq ($(ARCH_DETECTED), 64BITS_32)
|
||||
# tweak flags for 32-bit build on 64-bit system
|
||||
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
|
||||
ifneq ($(OS), OSX)
|
||||
ifeq ($(OS), MINGW)
|
||||
CFLAGS += -march=i686
|
||||
LDFLAGS += -Wl,-m,i386pe
|
||||
else
|
||||
CFLAGS += -m32
|
||||
LDFLAGS += -Wl,-m,elf_i386
|
||||
endif
|
||||
endif
|
||||
else
|
||||
ifeq ($(ARCH_DETECTED), 64BITS_32)
|
||||
$(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386)
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH_DETECTED), 64BITS)
|
||||
ifeq ($(OS), MINGW)
|
||||
CFLAGS += -march=x86-64
|
||||
LDFLAGS += -Wl,-m,i386pep
|
||||
endif
|
||||
endif
|
||||
|
||||
# set special flags per-system
|
||||
ifeq ($(OS), LINUX)
|
||||
# only export api symbols
|
||||
LDFLAGS += -Wl,-version-script,$(SRCDIR)/video_api_export.ver
|
||||
endif
|
||||
|
||||
# reduced compile output when running make without V=1
|
||||
ifneq ($(findstring $(MAKEFLAGS),s),s)
|
||||
ifndef V
|
||||
|
|
Loading…
Reference in a new issue