-
Notifications
You must be signed in to change notification settings - Fork 1
executable file
·81 lines (64 loc) · 2.86 KB
/
nightly_update.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
name: Nightly Update (EN)
on:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
container: ghcr.io/medabots/medarot4:tr_EN
steps:
- name: List versions
run: |
git --version
python3 --version
rgbasm --version
rgblink --version
rgbgfx --version
- name: Checkout main repository
uses: actions/checkout@v4
with:
path: 'code'
- name: Checkout baserom repository
uses: actions/checkout@v4
with:
repository: ${{ secrets.BASEROM_REPOSITORY }}
ssh-key: ${{ secrets.BASEROM_KEY }}
path: 'baserom'
- name: Copy baserom into main repository
run: |
cp $GITHUB_WORKSPACE/baserom/*.gbc $GITHUB_WORKSPACE/code
- name: Get Tag Info
working-directory: 'code'
run: |
git fetch --tags --all
echo "TAG_NAME=`git rev-parse --abbrev-ref HEAD`" >> $GITHUB_ENV
echo "LATEST_TAG_NAME=`git tag --list --sort=-authordate \"\`git name-rev --name-only HEAD\`+nightly.*\" | head -n 1`" >> $GITHUB_ENV
echo "NIGHTLY_TAG_NAME=`git rev-parse --abbrev-ref HEAD`+nightly.`date +%Y%m%d`" >> $GITHUB_ENV
- name: Get latest text from source
working-directory: 'code'
env:
TRANSLATION_SHEET: sheet.xlsx
run: |
wget -q --no-check-certificate "${{ secrets.TRANSLATION_SHEET_URL_SOURCE }}" -O $TRANSLATION_SHEET
make -j dump_xlsx
git status --porcelain
- name: Push and release if there are changes
working-directory: 'code'
run: |
[ -z "$(git status --porcelain)" ] && git diff --exit-code $LATEST_TAG_NAME && exit 0
git config user.email "${{ secrets.USER_EMAIL }}"
git config user.name "$GITHUB_ACTOR"
git commit -am "Nightly text update - `date +%Y%m%d`" && git push || echo "No text changes"
make -j all
sha1sum medarot4_*.gbc > medarot4.sha1sum
git diff --exit-code && exit 0 || echo -n $NIGHTLY_TAG_NAME > ./text/patch/tag.txt
make -j all
sha1sum medarot4_*.gbc > medarot4.sha1sum
git commit -am "Update tag"
git push
mkdir patch
cp medarot4.sha1sum ./patch/
flips --create baserom_kabuto.gbc medarot4_kabuto.gbc ./patch/medarot4kabuto-$GITHUB_RUN_NUMBER-`git rev-parse HEAD`.bps
flips --create baserom_kuwagata.gbc medarot4_kuwagata.gbc ./patch/medarot4kuwagata-$GITHUB_RUN_NUMBER-`git rev-parse HEAD`.bps
ghr -t ${{ secrets.GITHUB_TOKEN }} -b "Apply the patch for the version you want to the original ROM for that version with a BPS patcher such as https://medabots.github.io/RomPatcher.js/" -u $GITHUB_REPOSITORY_OWNER -r medarot4 -delete $NIGHTLY_TAG_NAME ./patch/