update_event #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: | |
- update_event | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Files | |
run: pip install -r requirements.txt | |
- name: Download Files | |
run: python script/setup.py | |
- name: Generate | |
run: | | |
python script/generate_characters.py | |
python script/generate_boards.py | |
python script/playerprofile.py | |
python script/userstats.py | |
python script/collection.py | |
python script/calender.py | |
python script/quests.py | |
python script/mailbox.py | |
- name: increase version | |
run: python script/update.py | |
- name: Get version | |
id: version | |
run: | | |
echo version=v$(jq -r '.version' src/version.json) >> $GITHUB_OUTPUT | |
echo changelog=$(curl -s "https://api.github.com/repos/HerrErde/subway-source/releases/latest" | jq -r '.body' | tr '\n' '\r\n') >> $GITHUB_OUTPUT | |
- name: Generate List | |
run: python script/list.py | |
- name: Commit and push updated version | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "actions@github.com" | |
git commit -am "auto update files ${{steps.version.outputs.version}}" | |
git push | |
- name: Convert & Zip | |
run: | | |
python script/convert.py | |
python script/encrypt.py | |
python script/zip.py | |
- name: Upload Data | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: '${{steps.version.outputs.version}}' | |
body: '${{steps.version.outputs.changelog}}' | |
files: | | |
SubwayBooster.zip | |
temp/data/characters_inventory.json | |
temp/data/boards_inventory.json | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} |