-
Notifications
You must be signed in to change notification settings - Fork 25
147 lines (132 loc) · 3.92 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
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
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Checkout mxml
uses: actions/checkout@v3
with:
repository: michaelrsweet/mxml
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/misc
current=$(date '+%Y-%m-%d %H:%M:%S %A (%Z %z)')
msg="Patch database version: $current"
msg_md="Patch archive built on: \`$current\`"
echo $msg > output/xml/build.txt
echo $msg > output/misc/patch_ver.txt
echo $msg > build.txt
echo $msg_md > patch_built.md
echo $msg
python .ci/file-autogen-xml.py "$(pwd)/patches/xml/*.xml" "$current"
mv output patch1
- name: Verify XML files
working-directory: mxml
run: |
clang ../.ci/test.c -lmxml -D__PC__
FILES="../patches/xml/*.xml"
i=0
for f in $FILES
do
./a.out $f
((i=i+1))
done
echo "Passed $i files"
- name: Verify Generated XML files
working-directory: mxml
run: |
FILES="../patch1/xml/*.xml"
i=0
for f in $FILES
do
./a.out $f
((i=i+1))
done
echo "Passed $i files"
- name: Pack zip
run: |
mkdir out
mv patch1 out/patches
cd out
chmod -R 0777 patches
zip -r ../patch1.zip patches/*
cd ..
mkdir patch1_artifact
mv out/patches patch1_artifact/patches
cp patch1.zip build.txt .github/README.md patch_built.md out/
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: patch1
path: patch1_artifact
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: patches
path: patches
- name: Deploy
if: |
github.ref_name == 'main' &&
github.event_name == 'push' &&
github.repository == 'GoldHEN/GoldHEN_Patch_Repository'
run: |
cd out
git init
git add -A
git config --local user.email "action@github.com"
git config --local user.name "GitHub Actions"
git commit -m 'Deploy patch asset'
- name: Force push to destination branch
if: |
github.ref_name == 'main' &&
github.event_name == 'push' &&
github.repository == 'GoldHEN/GoldHEN_Patch_Repository'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
force: true
directory: out
- name: Checkout website
if: |
github.ref_name == 'main' &&
github.event_name == 'push' &&
github.repository == 'GoldHEN/GoldHEN_Patch_Repository'
uses: actions/checkout@v3
with:
repository: illusion0001/illusion0001.github.io
- name: Run Website Workflow dispatch
if: |
github.ref_name == 'main' &&
github.event_name == 'push' &&
github.repository == 'GoldHEN/GoldHEN_Patch_Repository'
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_RUNNER }}
run: gh workflow run jekyll.yml