CI/CD: Update

This commit is contained in:
Jj0YzL5nvJ 2022-07-10 18:52:10 -06:00
parent 27580a8c33
commit 3cdee61a98
2 changed files with 75 additions and 38 deletions

View file

@ -20,11 +20,21 @@ jobs:
matrix:
include:
- cc: GCC
platform: x64
bits: 64
- cc: GCC
platform: x86
bits: 32
- cc: Clang
name: Linux / ${{ matrix.cc }} / x64 | x86
runs-on: ubuntu-20.04
platform: x64
bits: 64
- cc: Clang
platform: x86
bits: 32
name: Linux / ${{ matrix.cc }} / ${{ matrix.platform }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Get build dependencies and arrange the environment
run: |
sudo apt-get update
@ -32,6 +42,10 @@ jobs:
sudo ldconfig
- name: Build and related stuff
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}"
ORIG="$(pwd)"
if [[ "${{ matrix.cc }}" == "GCC" ]]; then
CC="gcc"
CXX="g++"
@ -39,22 +53,32 @@ jobs:
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
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
mkdir tmp
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 -j4
echo ""
make -C projects/unix install DESTDIR="${ORIG}/tmp"
echo ""
cd tmp/usr/local/lib/mupen64plus
ls -gG *.so
ldd mupen64plus-rsp-hle.so
cd "${ORIG}"
mkdir pkg
if [[ "${CC}" == "gcc" ]]; then tar cvzf pkg/mupen64plus-rsp-hle-${{ matrix.platform }}-g${G_REV}.tar.gz -C tmp/ "usr"; fi
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: mupen64plus-rsp-hle-${{ matrix.platform }}-g${{ env.G_REV }}
path: pkg/*
if-no-files-found: ignore
MSYS2:
strategy:
@ -75,45 +99,50 @@ jobs:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW${{ matrix.bits }}
update: true
install: >-
git
libtool
make
mingw-w64-${{ matrix.cross }}-gcc
mingw-w64-${{ matrix.cross }}-toolchain
- name: Build and related stuff
run: |
export OPTFLAGS="-O2 -flto"
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}"
ORIG="$(pwd)"
CC="gcc"
CXX="g++"
${CC} --version
echo ""
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
mkdir tmp
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
make CC="${CC}" CXX="${CXX}" BITS="${{ matrix.bits }}" -C projects/unix all -j4
echo ""
ls -gG projects/unix/*.dll
ldd projects/unix/mupen64plus-rsp-hle.dll
make -C projects/unix install PLUGINDIR="" SHAREDIR="" BINDIR="" MANDIR="" LIBDIR="" APPSDIR="" ICONSDIR="icons" INCDIR="api" LDCONFIG="true" DESTDIR="${ORIG}/tmp"
echo ""
ls -gG tmp/*.dll
ldd tmp/mupen64plus-rsp-hle.dll
- name: Copy binaries, dependencies, etc...
run: |
mkdir pkg
cd projects/unix
cd tmp
for BIN in *.dll
do
echo ":: Copying ${BIN}"
cp "${BIN}" ../../pkg/
cp "${BIN}" ../pkg/
done
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: mupen64plus-rsp-hle-msys2-${{ matrix.platform }}-g${{ env.G_REV }}
path: pkg/*
@ -133,8 +162,8 @@ jobs:
run:
shell: cmd
steps:
- uses: actions/checkout@v2
- uses: microsoft/setup-msbuild@v1.0.3
- uses: actions/checkout@v3
- uses: microsoft/setup-msbuild@v1
# with:
# vs-version: 16.11
- name: Build and related stuff
@ -159,19 +188,19 @@ jobs:
cd pkg
xcopy "..\backup" .
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: mupen64plus-rsp-hle-msvc-${{ matrix.platform }}-g${{ env.G_REV }}
path: pkg/*
Nightly-build:
runs-on: ubuntu-latest
needs: [MSYS2, MSVC]
needs: [Linux, MSYS2, MSVC]
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
path: binaries
- name: Get some tools
@ -184,20 +213,30 @@ jobs:
cd binaries
for BIN in *
do
echo ":: Creating ${BIN}.zip"
cd "${BIN}"
zip -r "../../pkg/${BIN}.zip" *
if [[ "${BIN:20:4}" == "msys" ]]; then
echo ":: Creating ${BIN}.zip"
zip -r "../../pkg/${BIN}.zip" *
elif [[ "${BIN:20:4}" == "msvc" ]]; then
echo ":: Creating ${BIN}.zip"
zip -r "../../pkg/${BIN}.zip" *
else
echo ":: Recovering ${BIN}.tar.gz"
mv *.tar.gz ../../pkg/
fi
cd ..
done
cd ../pkg
echo ""
for BIN in *.zip
for BIN in *
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
tigerdeep -l ${BIN} >> ../${BIN:0:19}.tiger.txt
sha256sum ${BIN} >> ../${BIN:0:19}.sha256.txt
sha512sum ${BIN} >> ../${BIN:0:19}.sha512.txt
done
mv ../*.tiger.txt .
mv ../*.sha*.txt .
echo ""
echo "TIGER:"
cat *.tiger.txt

View file

@ -169,7 +169,6 @@ ifeq ($(ARCH_DETECTED), 64BITS_32)
endif
ifneq ($(OS), OSX)
ifeq ($(OS), MINGW)
CFLAGS += -march=i686
LDFLAGS += -Wl,-m,i386pe
else
CFLAGS += -m32
@ -180,7 +179,6 @@ endif
ifeq ($(ARCH_DETECTED), 64BITS)
ifeq ($(OS), MINGW)
CFLAGS += -march=x86-64
LDFLAGS += -Wl,-m,i386pep
endif
endif