-
Notifications
You must be signed in to change notification settings - Fork 19
96 lines (81 loc) · 3.26 KB
/
update_repo.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
name: Update Repo
on:
schedule:
- cron: '30 22 * * *'
workflow_dispatch:
jobs:
update-versions:
runs-on: ubuntu-latest
steps:
- name: checkout repo content
uses: actions/checkout@v2
- name: setup python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: install dependencies
run: |
if [ -f ./requirements_versions.txt ]; then pip3 install -r ./requirements_versions.txt; fi
- name: run script
run: |
python3 process_versions.py
- name: push changes
run: |
git config --global user.name 'HamletDuFromage'
git config --global user.email '90281142+Homletbot@users.noreply.github.com'
git add versions.json
git add versions/*
if [[ `git status --porcelain` ]]; then
git commit -m "automatic: updated version files"
git push
else
echo "Nothing to commit!"
fi
update-cheats:
needs: update-versions
runs-on: ubuntu-latest
steps:
- name: checkout repo content
uses: actions/checkout@v2
with:
ref: 'master'
- name: setup python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: install python dependencies
run: |
if [ -f ./requirements_cheats.txt ]; then pip3 install -r ./requirements_cheats.txt; fi
- name: install dependencies
run: sudo apt-get install unrar
- name: run python script
run: |
python3 database_builder.py
- name: push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'HomletBot'
git config --global user.email '90281142+Homletbot@users.noreply.github.com'
git add cheats/ cheats_gfx/ cheats_gbatemp/
stat=$(git status --porcelain)
if [ ! -z "$stat" ]; then
git commit -m "automatic: updated cheat files"
git push
version=$(cat VERSION)
echo -e "Last updated: **$version**\n\nCheats updated:↷\n\`\`\`\n$(echo $stat | xargs python3 build_changelog.py)\n\`\`\`" > changelog.md
gh release create $version -F changelog.md
gh release upload $version ./gbatemp/contents.zip --clobber
gh release upload $version ./gbatemp/titles.zip --clobber
mv ./NX-60FPS-RES-GFX-Cheats-main/contents.zip ./NX-60FPS-RES-GFX-Cheats-main/contents_60fps-res-gfx.zip
mv ./NX-60FPS-RES-GFX-Cheats-main/titles.zip ./NX-60FPS-RES-GFX-Cheats-main/titles_60fps-res-gfx.zip
gh release upload $version ./NX-60FPS-RES-GFX-Cheats-main/contents_60fps-res-gfx.zip --clobber
gh release upload $version ./NX-60FPS-RES-GFX-Cheats-main/titles_60fps-res-gfx.zip --clobber
mv ./complete/contents.zip ./complete/contents_complete.zip
mv ./complete/titles.zip ./complete/titles_complete.zip
gh release upload $version ./complete/contents_complete.zip --clobber
gh release upload $version ./complete/titles_complete.zip --clobber
gh release upload $version VERSION --clobber
else
echo "Nothing to commit!"
fi