Skip to content

Commit 8b3e0a0

Browse files
authored
Merge pull request #20 from theypsilon/main
Remove calls to external repositories.
2 parents 6c5a987 + 1c0d633 commit 8b3e0a0

File tree

2 files changed

+5
-43
lines changed

2 files changed

+5
-43
lines changed

.github/generate_db.py

-38
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,17 @@
1414
# You should have received a copy of the GNU General Public License
1515
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
import sys
1817
import subprocess
1918
from pathlib import Path
20-
import configparser
21-
from inspect import currentframe, getframeinfo
22-
import itertools
2319
import os
24-
import io
2520
import hashlib
26-
import distutils.util
27-
import datetime
28-
import difflib
29-
import shutil
30-
import time
3121
import json
3222
import xml.etree.cElementTree as ET
33-
import urllib.request
3423

3524
def main():
3625

3726
print('START!')
3827

39-
rotations = dict()
40-
for line in urllib.request.urlopen('https://raw.githubusercontent.com/theypsilon/_arcade-organizer/master/rotations/mame-rotations.txt'):
41-
parts = line.decode('utf-8').split(',')
42-
if len(parts) == 2:
43-
rot = translate_mame_rotation(parts[1].strip('\n').lower())
44-
if rot is not None:
45-
rotations[parts[0]] = rot
46-
4728
mad_finder = MadFinder('mad')
4829
mad_reader = MadReader()
4930

@@ -55,13 +36,6 @@ def main():
5536
repeated = mad_reader.repeated()
5637
errors = mad_reader.errors()
5738

58-
for setname in rotations:
59-
if setname not in data:
60-
data[setname] = dict()
61-
62-
if 'rotation' not in data[setname]:
63-
data[setname]['rotation'] = rotations[setname]
64-
6539
create_orphan_branch('db')
6640
json_filename = 'mad_db.json'
6741
zip_filename = json_filename + '.zip'
@@ -95,18 +69,6 @@ def main():
9569

9670
print('Done.')
9771

98-
def translate_mame_rotation(rot):
99-
if rot == 'rot0':
100-
return 0
101-
elif rot == 'rot90':
102-
return 90
103-
elif rot == 'rot180':
104-
return 180
105-
elif rot == 'rot270':
106-
return 270
107-
else:
108-
return None
109-
11072
def translate_mad_rotation(rot):
11173
if rot == 'horizontal':
11274
return 0

.github/workflows/generate_db.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ on:
88
- main
99
workflow_dispatch:
1010

11+
permissions: write-all
12+
1113
jobs:
1214
build:
13-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-latest
1416

1517
steps:
16-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1719

1820
- name: Generate DBs
1921
run: |
2022
set -euo pipefail
2123
git config --global user.email "[email protected]"
2224
git config --global user.name "The CI/CD Bot"
23-
curl --fail --location https://raw.githubusercontent.com/theypsilon/MAD_Database_MiSTer/main/.github/generate_db.py > generate_db.py
24-
chmod +x generate_db.py
25-
./generate_db.py
25+
./.github/generate_db.py

0 commit comments

Comments
 (0)