Merge pull request #14 from Jj0YzL5nvJ/ci-schedule

CI/CD: Integrate scheduled builds and other...
This commit is contained in:
Richard Goedeken 2023-03-02 21:58:34 -08:00 committed by GitHub
commit 4f5f3ba69a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,7 +11,10 @@ on:
- '**/*.md'
- '.{gitattributes,gitignore,travis.yml}'
- 'appveyor.yml,README'
schedule:
- cron: '15 14 21 * *'
workflow_dispatch:
jobs:
Linux:
@ -33,37 +36,36 @@ jobs:
bits: 32
name: Linux / ${{ matrix.cc }} / ${{ matrix.platform }}
runs-on: ubuntu-22.04
if: (github.event_name == 'schedule' && github.repository == 'mupen64plus/mupen64plus-video-arachnoid') || (github.event_name != 'schedule')
steps:
- uses: actions/checkout@v3
- name: Get build dependencies and arrange the environment
run: |
if [[ "${{ matrix.platform }}" == "x86" ]]; then sudo dpkg --add-architecture i386; fi
echo "G_REV=$(git rev-parse --short HEAD)" >> "${GITHUB_ENV}"
if [[ ${{ matrix.bits }} -eq 32 ]]; then sudo dpkg --add-architecture i386; fi
sudo apt-get update
sudo apt-get -y install libgl1-mesa-dev
if [[ "${{ matrix.platform }}" == "x86" ]]; then
if [[ ${{ matrix.bits }} -eq 32 ]]; then
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
fi
sudo ldconfig
- name: Build and related stuff
- name: Build and related stuff, backup binaries
run: |
if [[ ${{ matrix.bits }} -eq 32 ]]; then export OPTFLAGS="-O2 -flto -mtune=pentium4"; else export OPTFLAGS="-O2 -flto -mtune=core2"; fi
G_REV=$(git rev-parse --short HEAD)
echo "G_REV=${G_REV}" >> "${GITHUB_ENV}"
if [[ ${{ matrix.bits }} -eq 32 ]]; then export PIC="1" CPU_TUNE="-msse2 -mtune=pentium4"; else CPU_TUNE="-mtune=core2"; fi
export OPTFLAGS="-O2 -flto ${CPU_TUNE}"
ORIG="$(pwd)"
if [[ "${{ matrix.cc }}" == "GCC" ]]; then
CC="gcc"
CXX="g++"
else
CC="gcc"
CXX="g++"
if [[ "${{ matrix.cc }}" != "GCC" ]]; then
CC="clang"
CXX="clang++"
fi
if [[ ${{ matrix.bits }} -eq 32 ]]; then export PIC="1"; fi
${CC} --version
echo ""
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
mkdir tmp
mkdir pkg
echo ""
echo ":: ${{ matrix.cc }} ${{ matrix.platform }} ::"
echo ""
@ -71,20 +73,18 @@ jobs:
echo ""
make CC="${CC}" CXX="${CXX}" BITS="${{ matrix.bits }}" -C projects/unix all -j4
echo ""
make -C projects/unix install DESTDIR="${ORIG}/tmp"
make -C projects/unix install DESTDIR="${ORIG}/pkg/"
echo ""
cd tmp/usr/local/lib/mupen64plus
ls -gG *.so
ldd mupen64plus-video-arachnoid.so
cd "${ORIG}"
mkdir pkg
if [[ "${CC}" == "gcc" ]]; then tar cvzf pkg/mupen64plus-video-arachnoid-${{ matrix.platform }}-g${G_REV}.tar.gz -C tmp/ "usr"; fi
ls -gG pkg/usr/local/lib/mupen64plus/*.so
echo ""
ldd pkg/usr/local/lib/mupen64plus/mupen64plus-video-arachnoid.so
tar cvzf pkg/mupen64plus-video-arachnoid-linux-${{ matrix.platform }}-g${{ env.G_REV }}.tar.gz -C pkg/ "usr"
- name: Upload artifact
if: matrix.cc == 'GCC'
uses: actions/upload-artifact@v3
with:
name: mupen64plus-video-arachnoid-${{ matrix.platform }}-g${{ env.G_REV }}
path: pkg/*
if-no-files-found: ignore
name: mupen64plus-video-arachnoid-linux-${{ matrix.platform }}-g${{ env.G_REV }}
path: pkg/*.tar.gz
MSYS2:
strategy:
@ -100,7 +100,8 @@ jobs:
cross: i686
bits: 32
name: Windows / MSYS2 ${{ matrix.cc }} / ${{ matrix.platform }}
runs-on: windows-2019
runs-on: windows-2022
if: (github.event_name == 'schedule' && github.repository == 'mupen64plus/mupen64plus-video-arachnoid') || (github.event_name != 'schedule')
defaults:
run:
shell: msys2 {0}
@ -116,17 +117,18 @@ jobs:
make
mingw-w64-${{ matrix.cross }}-gcc
mingw-w64-${{ matrix.cross }}-toolchain
- name: Build and related stuff
- name: Build and related stuff, backup binaries
run: |
if [[ ${{ matrix.bits }} -eq 32 ]]; then export OPTFLAGS="-O2 -flto -mtune=pentium4"; else export OPTFLAGS="-O2 -flto -mtune=core2"; fi
echo "G_REV=$(git rev-parse --short HEAD)" >> "${GITHUB_ENV}"
if [[ ${{ matrix.bits }} -eq 32 ]]; then CPU_TUNE="-msse2 -mtune=pentium4"; else CPU_TUNE="-mtune=core2"; fi
export OPTFLAGS="-O2 -flto ${CPU_TUNE}"
ORIG="$(pwd)"
CC="gcc"
CXX="g++"
${CC} --version
echo ""
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
mkdir tmp
mkdir pkg
echo ""
echo ":: ${{ matrix.cc }} ${{ matrix.platform }} ::"
echo ""
@ -134,25 +136,18 @@ jobs:
echo ""
make CC="${CC}" CXX="${CXX}" BITS="${{ matrix.bits }}" -C projects/unix all -j4
echo ""
make -C projects/unix install PLUGINDIR="" SHAREDIR="" BINDIR="" MANDIR="" LIBDIR="" APPSDIR="" ICONSDIR="icons" INCDIR="api" LDCONFIG="true" DESTDIR="${ORIG}/tmp"
make -C projects/unix install PLUGINDIR="" SHAREDIR="" BINDIR="" MANDIR="" LIBDIR="" APPSDIR="" ICONSDIR="icons" INCDIR="api" LDCONFIG="true" DESTDIR="${ORIG}/pkg/"
echo ""
ls -gG tmp/*.dll
ldd tmp/mupen64plus-video-arachnoid.dll
- name: Copy binaries, dependencies, etc...
ls -gG pkg/*.dll
echo ""
ldd pkg/mupen64plus-video-arachnoid.dll
- name: Backup 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
for LIB in ${LIBGCC} libstdc++-6 libwinpthread-1; do
echo ":: Copying ${LIB}.dll"
cp "/mingw${{ matrix.bits }}/bin/${LIB}.dll" pkg/
done
cd tmp
for BIN in *.dll
do
echo ":: Copying ${BIN}"
cp "${BIN}" ../pkg/
done
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
@ -161,8 +156,8 @@ jobs:
Nightly-build:
runs-on: ubuntu-latest
if: github.ref_name == 'master'
needs: [Linux, MSYS2]
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Download artifacts
@ -177,8 +172,7 @@ jobs:
run: |
mkdir pkg
cd binaries
for BIN in *
do
for BIN in *; do
cd "${BIN}"
if [[ "${BIN:28:4}" == "msys" ]]; then
echo ":: Creating ${BIN}.zip"
@ -191,10 +185,9 @@ jobs:
done
cd ../pkg
echo ""
for BIN in *
do
for BIN in *; do
ls -gG ${BIN}
tigerdeep -l ${BIN} >> ../${BIN:0:27}.tiger.txt
tigerdeep -lz ${BIN} >> ../${BIN:0:27}.tiger.txt
sha256sum ${BIN} >> ../${BIN:0:27}.sha256.txt
sha512sum ${BIN} >> ../${BIN:0:27}.sha512.txt
done