-
Notifications
You must be signed in to change notification settings - Fork 25
164 lines (150 loc) · 5.1 KB
/
zip.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
name: Pack patch zip
on:
push:
paths-ignore:
- "**/*.md"
- '**/*.txt'
pull_request:
paths-ignore:
- "**/*.md"
- '**/*.txt'
workflow_dispatch:
jobs:
zip-patches:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@main
with:
submodules: recursive
- name: Checkout mxml
uses: actions/checkout@main
with:
repository: bucanero/mxml
ref: f2d6c728b85333a9734bd7eebd4131c65ad11da2
path: mxml
- name: Configure mxml
working-directory: mxml
env:
CC: /usr/bin/gcc
run: ./configure --enable-debug --enable-maintainer
- name: Build mxml
working-directory: mxml
run: |
sudo make
sudo make install
echo LD_LIBRARY_PATH=$(pwd) >> $GITHUB_ENV
- name: Generate TitleID files
run: |
mkdir -p output/xml
mkdir -p output/xml_prospero
mkdir -p output/misc
current=$(date '+%Y-%m-%d %H:%M:%S %A (%Z %z)')
echo "current_time=$(date +%s)" >> ${{ github.env }}
echo "current_date=$current" >> ${{ github.env }}
msg="Patch database version: $current"
msg_md="Patch archive built on: \`$current\`"
echo $msg > output/xml/build.txt
echo $msg > output/xml_prospero/build.txt
echo $msg > output/misc/patch_ver.txt
echo $msg > output/build.txt
echo $msg_md > output/patch_built.md
echo $msg
echo $msg_md
python .ci/file-autogen-xml.py "$(pwd)/patches/xml/*.xml" "$current" "output/xml" > ${{ github.workspace }}/gen_ps4.log
python .ci/file-autogen-xml.py "$(pwd)/patches/xml_prospero/*.xml" "$current" "output/xml_prospero" > ${{ github.workspace }}/gen_ps5.log
mv output patch1
- name: Verify XML files
working-directory: mxml
run: |
clang ../.ci/test.c -lmxml -D__PC__
FILES="../patches/xml/*.xml"
FILES_PS5="../patches/xml_prospero/*.xml"
i=0
for f in $FILES
do
./a.out $f >> ${{ github.workspace }}/verify_ps4.log
((i=i+1))
done
for f in $FILES_PS5
do
./a.out $f >> ${{ github.workspace }}/verify_ps5.log
((i=i+1))
done
echo "Passed $i files"
- name: Verify Generated XML files
working-directory: mxml
run: |
FILES="../patch1/xml/*.xml"
FILES_PS5="../patches/xml_prospero/*.xml"
i=0
for f in $FILES
do
./a.out $f >> ${{ github.workspace }}/verify_ps4.log
((i=i+1))
done
for f in $FILES_PS5
do
./a.out $f >> ${{ github.workspace }}/verify_ps5.log
((i=i+1))
done
echo "Passed $i files"
- name: Pack zip
run: |
mkdir out
mv patch1 out/patches
cd out
zip -r ${{ github.workspace }}/patch1.zip patches/* patches/build.txt patches/misc/patch_ver.txt
mkdir ../patch1_artifact
mv patches ../patch1_artifact/patches
- name: Upload artifact
uses: actions/upload-artifact@main
with:
name: patch1
path: patch1_artifact
- name: Upload artifact logs
if: success() || failure()
uses: actions/upload-artifact@main
with:
name: logs
path: ./*.log
- name: Create Release
if: |
github.ref_name == 'main' &&
github.event_name == 'push' &&
github.repository == 'illusion0001/PS4-PS5-Game-Patch'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
hash_md="hash.md"
echo "# Release date" > $hash_md
echo "- \`${{ env.current_date }}\`" >> $hash_md
echo "## File details" >> $hash_md
echo "" >> $hash_md
echo "<details>" >> $hash_md
echo "<summary>File hashes (Click to Expand)</summary>" >> $hash_md
echo "" >> $hash_md
echo "\`\`\`sha256" >> $hash_md
echo "$(sha256sum ${{ github.workspace }}/patch1.zip)" >> $hash_md
echo "\`\`\`" >> $hash_md
echo "" >> $hash_md
echo "</details>" >> $hash_md
gh release create "${{ env.current_time }}" "${{ github.workspace }}/patch1.zip" --target "${{ GITHUB.SHA }}" -t "${{ env.current_date }}" -F $hash_md
- name: Checkout website
if: |
github.ref_name == 'main' &&
github.event_name == 'push' &&
github.repository == 'illusion0001/PS4-PS5-Game-Patch'
uses: actions/checkout@main
with:
repository: illusion0001/illusion0001.github.io
- name: Run Website Workflow dispatch
if: |
github.ref_name == 'main' &&
github.event_name == 'push' &&
github.repository == 'illusion0001/PS4-PS5-Game-Patch'
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_RUNNER }}
run: gh workflow run jekyll.yml