-
Notifications
You must be signed in to change notification settings - Fork 13
161 lines (142 loc) · 5.02 KB
/
CI.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Build modules
on:
push:
paths-ignore:
- "**/*.md"
- '**/*.txt'
pull_request:
paths-ignore:
- "**/*.md"
- '**/*.txt'
workflow_dispatch:
# for release create
permissions:
contents: write
concurrency:
group: ${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
build_prx:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Checkout SDK
uses: actions/checkout@v3
with:
repository: GoldHEN/GoldHEN_Plugins_SDK
path: SDK
- name: Checkout mxml
uses: actions/checkout@v3
with:
repository: illusion0001/mxml
ref: clang-14
path: mxml
- name: Setup variables
run: |
sudo apt install llvm lld
echo "OO_PS4_TOOLCHAIN=$GITHUB_WORKSPACE/OpenOrbis/PS4Toolchain" >> $GITHUB_ENV
echo "commit_ver=1.$(git rev-list HEAD --count)" >> $GITHUB_ENV
echo "commit_hash=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_ENV
- name: Download OpenOrbis Toolchain
run: curl -sL https://github.com/illusion0001/OpenOrbis-PS4-Toolchain/releases/latest/download/toolchain.tar.gz | tar xz -C ./
- name: Install mini xml
working-directory: mxml/ps4
run: |
wget https://raw.githubusercontent.com/bucanero/oosdk_libraries/master/build_rules.mk -O $OO_PS4_TOOLCHAIN/build_rules.mk
make install PRX_BUILD=1
- name: Export path to SDK
working-directory: SDK
run: echo "GOLDHEN_SDK=$(pwd)" >> $GITHUB_ENV
- name: Build (Release)
run: make
- name: Build (Debug)
run: make DEBUG=1
- name: Upload modules (Release prx)
uses: actions/upload-artifact@v3
with:
name: goldplugins_${{ env.commit_ver }}-${{ env.commit_hash }}_prx_final
path: bin/plugins/prx_final/*.prx
if-no-files-found: error
- name: Upload modules (Release elf symbols)
uses: actions/upload-artifact@v3
with:
name: goldplugins_${{ env.commit_ver }}-${{ env.commit_hash }}_elf_final
path: bin/plugins/elf_final/*.elf
if-no-files-found: error
- name: Upload modules (Debug prx)
uses: actions/upload-artifact@v3
with:
name: goldplugins_${{ env.commit_ver }}-${{ env.commit_hash }}_prx_debug
path: bin/plugins/prx_debug/*.prx
if-no-files-found: error
- name: Upload modules (Debug elf symbols)
uses: actions/upload-artifact@v3
with:
name: goldplugins_${{ env.commit_ver }}-${{ env.commit_hash }}_elf_debug
path: bin/plugins/elf_debug/*.elf
if-no-files-found: error
- name: Prepare Release
if: github.event_name == 'workflow_dispatch'
run: |
# Excluding non user related plugins from release
BUILD=plugins
cd bin/plugins
mv prx_final $BUILD
chmod -R 0777 $BUILD
BUILD_MD5="md5.txt"
BUILD_SHA256="sha256.txt"
echo "MD5:" > $BUILD/$BUILD_MD5
echo "SHA256:" > $BUILD/$BUILD_SHA256
FILES="$BUILD/*.prx"
for f in $FILES
do
if [[ "$f" == "$BUILD/game_call_example.prx" ]] ||
[[ "$f" == "$BUILD/plugin_loader.prx" ]] ||
[[ "$f" == "$BUILD/plugin_template.prx" ]]; then
echo "[+] Skipping $f"
rm $f
continue
fi
echo "$(sha256sum $f)" >> $BUILD/$BUILD_SHA256
echo "$(md5sum $f)" >> $BUILD/$BUILD_MD5
done
cat $BUILD/$BUILD_MD5
cat $BUILD/$BUILD_SHA256
# Create zip
ZIP_NAME=GoldPlugins-${{ env.commit_ver }}-${{ env.commit_hash }}
CFG=plugins.ini
echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_ENV
echo "; Note: lines starting with semicolon are for comments." > $CFG
echo "; Load plugins for any title." >> $CFG
echo "" >> $CFG
echo "[default]" >> $CFG
echo "/data/GoldHEN/plugins/game_patch.prx" >> $CFG
echo "" >> $CFG
echo "; Load plugins only for Playroom." >> $CFG
echo "" >> $CFG
echo "[CUSA00001]" >> $CFG
echo "/data/GoldHEN/plugins/afr.prx" >> $CFG
echo "/data/GoldHEN/plugins/no_share_watermark.prx" >> $CFG
zip -r $ZIP_NAME.zip plugins/* $CFG
echo "<details>" > hash.md
echo "<summary>Plugin Hashes (Click to Expand)</summary>" >> hash.md
echo "" >> hash.md
echo "\`\`\`md5" >> hash.md
cat plugins/md5.txt >> hash.md
echo "\`\`\`" >> hash.md
echo "" >> hash.md
echo "\`\`\`sha256" >> hash.md
cat plugins/sha256.txt >> hash.md
echo "\`\`\`" >> hash.md
echo "" >> hash.md
echo "</details>" >> hash.md
- name: Create Release
if: github.event_name == 'workflow_dispatch'
working-directory: bin/plugins
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create ${{ env.commit_ver }} ${{ env.ZIP_NAME }}.zip --target ${{ GITHUB.SHA }} -t "${{ env.commit_ver }}" -F hash.md