CI/CD: Integrate scheduled builds and other necessary updates

This commit is contained in:
Jj0YzL5nvJ 2023-02-14 23:49:22 -06:00
parent 39f79201ba
commit 3e3cfe3296
2 changed files with 45 additions and 64 deletions

View file

@ -11,7 +11,10 @@ on:
- '**/*.md' - '**/*.md'
- '.{gitattributes,gitignore,travis.yml}' - '.{gitattributes,gitignore,travis.yml}'
- 'appveyor.yml,README' - 'appveyor.yml,README'
schedule:
- cron: '35 14 21 * *'
workflow_dispatch: workflow_dispatch:
jobs: jobs:
Linux: Linux:
@ -33,33 +36,31 @@ jobs:
bits: 32 bits: 32
name: Linux / ${{ matrix.cc }} / ${{ matrix.platform }} name: Linux / ${{ matrix.cc }} / ${{ matrix.platform }}
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
if: (github.event_name == 'schedule' && github.repository == 'mupen64plus/mupen64plus-rsp-cxd4') || (github.event_name != 'schedule')
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Get build dependencies and arrange the environment - name: Get build dependencies and arrange the environment
run: | run: |
echo "G_REV=$(git rev-parse --short HEAD)" >> "${GITHUB_ENV}"
sudo apt-get update sudo apt-get update
sudo apt-get --reinstall -y install gcc-multilib g++-multilib libc6 libc6-dev-i386 sudo apt-get --reinstall -y install gcc-multilib g++-multilib libc6 libc6-dev-i386
sudo ldconfig sudo ldconfig
- name: Build and related stuff - name: Build and related stuff, backup binaries
run: | run: |
if [[ ${{ matrix.bits }} -eq 32 ]]; then export OPTFLAGS="-O2 -flto -mtune=pentium4"; else export OPTFLAGS="-O2 -flto -mtune=core2"; fi if [[ ${{ matrix.bits }} -eq 32 ]]; then export PIC="1" CPU_TUNE="-mtune=pentium4"; else CPU_TUNE="-mtune=core2"; fi
G_REV=$(git rev-parse --short HEAD) export OPTFLAGS="-O2 -flto ${CPU_TUNE}"
echo "G_REV=${G_REV}" >> "${GITHUB_ENV}"
ORIG="$(pwd)" ORIG="$(pwd)"
if [[ "${{ matrix.cc }}" == "GCC" ]]; then CC="gcc"
CC="gcc" CXX="g++"
CXX="g++" if [[ "${{ matrix.cc }}" != "GCC" ]]; then
else
CC="clang" CC="clang"
CXX="clang++" CXX="clang++"
fi fi
if [[ ${{ matrix.bits }} -eq 32 ]]; then export PIC="1"; fi
${CC} --version ${CC} --version
echo "" echo ""
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
mkdir tmp mkdir pkg
for SSE in none SSE2 for SSE in none SSE2; do
do
echo "" echo ""
echo ":: ${{ matrix.cc }} ${{ matrix.platform }}${MSG} ::" echo ":: ${{ matrix.cc }} ${{ matrix.platform }}${MSG} ::"
echo "" echo ""
@ -67,23 +68,21 @@ jobs:
echo "" echo ""
make CC="${CC}" CXX="${CXX}" BITS="${{ matrix.bits }}" SSE="${SSE}" -C projects/unix all -j4 make CC="${CC}" CXX="${CXX}" BITS="${{ matrix.bits }}" SSE="${SSE}" -C projects/unix all -j4
echo "" echo ""
make SSE="${SSE}" -C projects/unix install DESTDIR="${ORIG}/tmp" make SSE="${SSE}" -C projects/unix install DESTDIR="${ORIG}/pkg/"
echo "" echo ""
cd tmp/usr/local/lib/mupen64plus ls -gG pkg/usr/local/lib/mupen64plus/mupen64plus-rsp-cxd4${LIB}.so
ls -gG mupen64plus-rsp-cxd4${LIB}.so echo ""
ldd mupen64plus-rsp-cxd4${LIB}.so ldd pkg/usr/local/lib/mupen64plus/mupen64plus-rsp-cxd4${LIB}.so
LIB="-sse2" LIB="-sse2"
MSG=" / SSE2" MSG=" / SSE2"
cd "${ORIG}"
done done
mkdir pkg tar cvzf pkg/mupen64plus-rsp-cxd4-linux-${{ matrix.platform }}-g${{ env.G_REV }}.tar.gz -C pkg/ "usr"
if [[ "${CC}" == "gcc" ]]; then tar cvzf pkg/mupen64plus-rsp-cxd4-${{ matrix.platform }}-g${G_REV}.tar.gz -C tmp/ "usr"; fi
- name: Upload artifact - name: Upload artifact
if: matrix.cc == 'GCC'
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: mupen64plus-rsp-cxd4-${{ matrix.platform }}-g${{ env.G_REV }} name: mupen64plus-rsp-cxd4-linux-${{ matrix.platform }}-g${{ env.G_REV }}
path: pkg/* path: pkg/*.tar.gz
if-no-files-found: ignore
MSYS2: MSYS2:
strategy: strategy:
@ -99,7 +98,8 @@ jobs:
cross: i686 cross: i686
bits: 32 bits: 32
name: Windows / MSYS2 ${{ matrix.cc }} / ${{ matrix.platform }} name: Windows / MSYS2 ${{ matrix.cc }} / ${{ matrix.platform }}
runs-on: windows-2019 runs-on: windows-2022
if: (github.event_name == 'schedule' && github.repository == 'mupen64plus/mupen64plus-rsp-cxd4') || (github.event_name != 'schedule')
defaults: defaults:
run: run:
shell: msys2 {0} shell: msys2 {0}
@ -115,19 +115,19 @@ jobs:
make make
mingw-w64-${{ matrix.cross }}-gcc mingw-w64-${{ matrix.cross }}-gcc
mingw-w64-${{ matrix.cross }}-toolchain mingw-w64-${{ matrix.cross }}-toolchain
- name: Build and related stuff - name: Build and related stuff, backup binaries
run: | 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}" echo "G_REV=$(git rev-parse --short HEAD)" >> "${GITHUB_ENV}"
if [[ ${{ matrix.bits }} -eq 32 ]]; then CPU_TUNE="-mtune=pentium4"; else CPU_TUNE="-mtune=core2"; fi
export OPTFLAGS="-O2 -flto ${CPU_TUNE}"
ORIG="$(pwd)" ORIG="$(pwd)"
CC="gcc" CC="gcc"
CXX="g++" CXX="g++"
${CC} --version ${CC} --version
echo "" echo ""
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
mkdir tmp mkdir pkg
for SSE in none SSE2 for SSE in none SSE2; do
do
echo "" echo ""
echo ":: ${{ matrix.cc }} ${{ matrix.platform }}${MSG} ::" echo ":: ${{ matrix.cc }} ${{ matrix.platform }}${MSG} ::"
echo "" echo ""
@ -135,22 +135,14 @@ jobs:
echo "" echo ""
make CC="${CC}" CXX="${CXX}" BITS="${{ matrix.bits }}" SSE="${SSE}" -C projects/unix all -j4 make CC="${CC}" CXX="${CXX}" BITS="${{ matrix.bits }}" SSE="${SSE}" -C projects/unix all -j4
echo "" echo ""
make SSE="${SSE}" -C projects/unix install PLUGINDIR="" SHAREDIR="" BINDIR="" MANDIR="" LIBDIR="" APPSDIR="" ICONSDIR="icons" INCDIR="api" LDCONFIG="true" DESTDIR="${ORIG}/tmp" make SSE="${SSE}" -C projects/unix install PLUGINDIR="" SHAREDIR="" BINDIR="" MANDIR="" LIBDIR="" APPSDIR="" ICONSDIR="icons" INCDIR="api" LDCONFIG="true" DESTDIR="${ORIG}/pkg/"
echo "" echo ""
ls -gG tmp/mupen64plus-rsp-cxd4${LIB}.dll ls -gG pkg/mupen64plus-rsp-cxd4${LIB}.dll
ldd tmp/mupen64plus-rsp-cxd4${LIB}.dll echo ""
ldd pkg/mupen64plus-rsp-cxd4${LIB}.dll
LIB="-sse2" LIB="-sse2"
MSG=" / SSE2" MSG=" / SSE2"
done done
- name: Copy binaries, dependencies, etc...
run: |
mkdir pkg
cd tmp
for BIN in *.dll
do
echo ":: Copying ${BIN}"
cp "${BIN}" ../pkg/
done
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@ -168,37 +160,30 @@ jobs:
- toolset: v141_xp - toolset: v141_xp
platform: x86 platform: x86
vs: 2019 vs: 2019
name: Windows / MSVC ${{ matrix.toolset }} / ${{ matrix.platform }} name: Windows / MSVC with ${{ matrix.toolset }} / ${{ matrix.platform }}
runs-on: windows-${{ matrix.vs }} runs-on: windows-${{ matrix.vs }}
if: (github.event_name == 'schedule' && github.repository == 'mupen64plus/mupen64plus-rsp-cxd4') || (github.event_name != 'schedule')
defaults: defaults:
run: run:
shell: cmd shell: cmd
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: microsoft/setup-msbuild@v1 - uses: microsoft/setup-msbuild@v1
# with: - name: Build and related stuff, backup binaries
# vs-version: 16.11
- name: Build and related stuff
run: | run: |
for /f "tokens=1" %%R in ('git rev-parse --short HEAD') do set "G_REV=%%R" for /f "tokens=1" %%R in ('git rev-parse --short HEAD') do echo G_REV=%%R>> "%GITHUB_ENV%"
echo G_REV=%G_REV%>> "%GITHUB_ENV%"
set "ARCH=${{ matrix.platform }}" set "ARCH=${{ matrix.platform }}"
if [%ARCH%] == [x86] set "ARCH=Win32" if [%ARCH%] == [x86] set "ARCH=Win32"
echo. echo.
msbuild --version msbuild --version
echo. echo.
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ..\mupen64plus-core git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ..\mupen64plus-core
md pkg
echo. echo.
msbuild projects\msvc\mupen64plus-rsp-cxd4.vcxproj /p:Configuration=Release;Platform=%ARCH%;PlatformToolset=${{ matrix.toolset }} msbuild projects\msvc\mupen64plus-rsp-cxd4.vcxproj /p:Configuration=Release;Platform=%ARCH%;PlatformToolset=${{ matrix.toolset }}
echo. echo.
md backup copy "projects\msvc\%ARCH%\Release\mupen64plus-rsp-cxd4.dll" pkg\
copy projects\msvc\%ARCH%\Release\mupen64plus-rsp-cxd4.dll backup\ dir pkg\*.dll
dir backup\*.dll
- name: Copy binaries, dependencies, etc...
run: |
md pkg
cd pkg
xcopy "..\backup" .
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@ -207,8 +192,8 @@ jobs:
Nightly-build: Nightly-build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.ref_name == 'master'
needs: [Linux, MSYS2, MSVC] needs: [Linux, MSYS2, MSVC]
if: github.ref == 'refs/heads/master'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Download artifacts - name: Download artifacts
@ -223,8 +208,7 @@ jobs:
run: | run: |
mkdir pkg mkdir pkg
cd binaries cd binaries
for BIN in * for BIN in *; do
do
cd "${BIN}" cd "${BIN}"
if [[ "${BIN:21:4}" == "msys" ]]; then if [[ "${BIN:21:4}" == "msys" ]]; then
echo ":: Creating ${BIN}.zip" echo ":: Creating ${BIN}.zip"
@ -240,10 +224,9 @@ jobs:
done done
cd ../pkg cd ../pkg
echo "" echo ""
for BIN in * for BIN in *; do
do
ls -gG ${BIN} ls -gG ${BIN}
tigerdeep -l ${BIN} >> ../${BIN:0:20}.tiger.txt tigerdeep -lz ${BIN} >> ../${BIN:0:20}.tiger.txt
sha256sum ${BIN} >> ../${BIN:0:20}.sha256.txt sha256sum ${BIN} >> ../${BIN:0:20}.sha256.txt
sha512sum ${BIN} >> ../${BIN:0:20}.sha512.txt sha512sum ${BIN} >> ../${BIN:0:20}.sha512.txt
done done

View file

@ -2,6 +2,8 @@ version: 1.0.{build}
image: Visual Studio 2022 image: Visual Studio 2022
skip_tags: true
skip_commits: skip_commits:
files: files:
- '**/*.md' - '**/*.md'
@ -12,10 +14,6 @@ skip_commits:
- .travis.yml - .travis.yml
- README - README
branches:
except:
- nightly-build
configuration: configuration:
- Release - Release
platform: platform: