-
Notifications
You must be signed in to change notification settings - Fork 13
186 lines (165 loc) · 5.79 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: Build modules
on:
push:
paths-ignore:
- "**/*.md"
- '**/*.txt'
pull_request:
paths-ignore:
- "**/*.md"
- '**/*.txt'
workflow_dispatch:
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: patch-1
path: mxml
- name: Setup variables
run: |
echo "llvm_ver=12.0" >> $GITHUB_ENV
echo "llvm_path=$RUNNER_TOOL_CACHE/llvm" >> $GITHUB_ENV
echo "OO_PS4_TOOLCHAIN=$GITHUB_WORKSPACE/OpenOrbis/PS4Toolchain" >> $GITHUB_ENV
echo "commit_ver=1.$(git rev-list HEAD --count)" >> $GITHUB_ENV
- name: Cache OpenOrbis Toolchain
id: cache-oosdk
uses: actions/cache@v3
with:
path: ${{ env.OO_PS4_TOOLCHAIN }}
key: ${{ runner.os }}-oosdk
# temporary release until 0.53 is released
- name: Download OpenOrbis Toolchain
if: steps.cache-oosdk.outputs.cache-hit != 'true'
run: curl -sL https://github.com/illusion0001/OpenOrbis-PS4-Toolchain/releases/download/0.0.1.416/toolchain.tar.gz | tar xz -C ./
- name: Cache LLVM and Clang (${{ env.llvm_ver }})
id: cache-llvm
uses: actions/cache@v3
with:
path: ${{ env.llvm_path }}
key: llvm-${{ env.llvm_ver }}
- name: Install LLVM and Clang (${{ env.llvm_ver }})
uses: KyleMayes/install-llvm-action@v1
with:
version: ${{ env.llvm_ver }}
directory: ${{ env.llvm_path }}
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
- 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: Push module artifact (Release prx)
uses: actions/upload-artifact@v3
with:
name: goldplugins_${{ env.commit_ver }}_prx_final
path: bin/plugins/prx_final/*
if-no-files-found: error
- name: Push module artifact (Release elf)
uses: actions/upload-artifact@v3
with:
name: goldplugins_${{ env.commit_ver }}_elf_final
path: bin/plugins/elf_final/*.elf
if-no-files-found: error
- name: Push module artifact (Debug prx)
uses: actions/upload-artifact@v3
with:
name: goldplugins_${{ env.commit_ver }}_prx_debug
path: bin/plugins/prx_debug/*
if-no-files-found: error
- name: Push module artifact (Debug elf)
uses: actions/upload-artifact@v3
with:
name: goldplugins_${{ env.commit_ver }}_elf_debug
path: bin/plugins/elf_debug/*.elf
if-no-files-found: error
- name: Prepare Release
if: |
github.event_name == 'workflow_dispatch' &&
github.repository == 'GoldHEN/GoldHEN_Plugins_Repository'
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
commit_hash=$(echo ${GITHUB_SHA} | cut -c1-8)
ZIP_NAME=GoldPlugins-${{ env.commit_ver }}-$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
working-directory: bin/plugins
if: |
github.event_name == 'workflow_dispatch' &&
github.repository == 'GoldHEN/GoldHEN_Plugins_Repository'
env:
GITHUB_TOKEN: ${{ secrets.my_token }}
run: |
gh release create ${{ env.commit_ver }} ${{ env.ZIP_NAME }}.zip --target ${{ GITHUB.SHA }} -t "${{ env.commit_ver }}" -F hash.md