forked from slaminger/rrvl-cores
-
Notifications
You must be signed in to change notification settings - Fork 15
111 lines (101 loc) · 4.31 KB
/
snes9x.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# This is a basic workflow that is manually triggered to update the snes9x libretro core for aarch64
name: Libretro snes9x core update
on:
workflow_dispatch:
jobs:
# This workflow contains a single job.
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Time to pull the proper branch of the retroarch-cores repo to start the build process
#- uses: actions/checkout@v3
#with:
#ref: ${{ github.ref_name }}
#fetch-depth: 1
#- name: checkout rk3566_core_builds
#uses: actions/checkout@v3
#with:
#repository: christianhaitian/rk3566_core_builds
#ref: master
#fetch-depth: 0
- uses: uraimo/run-on-arch-action@v2
name: checkout retroarch_cores repo
with:
# arch: aarch64
distro: ubuntu20.04
run: |
apt -y update
apt -y install build-essential git libarchive-zip-perl rsync zip python3 python3-pip python3-setuptools python3-wheel ninja-build libopenal-dev premake4 autoconf gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf
bitness="$(getconf LONG_BIT)"
if [[ "$bitness" == "64" ]]; then
arch="aarch64"
else
arch="armhf"
fi
if [[ ${GITHUB_REF##*/} == "master" ]]; then
whichgit="rk3326_core_builds"
else
whichgit="rk3566_core_builds"
fi
git clone --recursive https://github.com/christianhaitian/${whichgit}.git
cd ${whichgit}
git clone --recursive https://github.com/libretro/snes9x.git
cp patches/snes9x-patch* snes9x/.
cd snes9x/
snes9x_patches=$(find *.patch)
if [[ ! -z "$snes9x_patches" ]]; then
for patching in snes9x-patch*
do
patch -Np1 < "$patching"
if [[ $? != "0" ]]; then
echo " "
echo "There was an error while applying $patching. Stopping here."
exit 1
fi
rm "$patching"
fi
done
fi
cd libretro
make clean
CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ make -j$(nproc)
if [[ $? != "0" ]]; then
echo " "
echo "There was an error while building the newest lr-snes9x core. Stopping here."
exit 1
fi
strip snes9x_libretro.so
if [ ! -d "../../cores$bitness/" ]; then
mkdir -v ../../cores$bitness
fi
cp snes9x_libretro.so ../../cores$bitness/.
gitcommit=$(git log | grep -m 1 commit | cut -c -14 | cut -c 8-)
echo $gitcommit > ../../cores$bitness/snes9x_libretro.so.commit
cd ..
cd ..
git config --global http.postBuffer 500M
git config --global http.maxRequestBuffer 100M
git config --global core.compression 0
#git clone https://github.com/christianhaitian/retroarch-cores.git -b ${{ github.ref_name }}
git clone https://github.com/christianhaitian/retroarch-cores.git -b dev
cd retroarch-cores/${arch}
#cd aarch64
cp ../../${whichgit}/cores$bitness/snes9x_libretro.so .
../addcore snes9x_libretro.so
cd ..
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add ${arch}/snes9x_libretro.so.zip
git commit -m "Updated snes9x_libretro ${bitness}bit core to commit $(cat ../../${whichgit}/cores$bitness/snes9x_libretro.so.commit)"
#rm -rf retroarch-cores
#rm -rf ../cores$bitness
#rm -rf ../snes9x
git add .
git commit -m "Update index and index-extended for recent core updates"
git push
#- name: Push new snes9x libretro cores build to repo
#uses: ad-m/github-push-action@master
#with:
#branch: ${{ github.ref_name }}