Skip to content

update_event

update_event #38

Workflow file for this run

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: Set vars
id: var
run: |
packageId="com.kiloo.subwaysurf" >> $GITHUB_OUTPUT
echo version=$(curl -s "https://gplayapi.herrerde.xyz/api/apps/$packageId" | jq -r '.version' | tr '.' '-') >> $GITHUB_OUTPUT
- name: Setup Python
uses: actions/setup-python@v5.1.0
with:
python-version: '3.x'
cache: 'pip'
- name: Install
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/challenges.py
python script/calender.py
python script/quests.py
python script/mailbox.py
python script/achievements.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/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 }}