update_version_api #723
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_version_api | |
on: | |
workflow_dispatch: | |
release: | |
jobs: | |
update_version_api: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- name: Update Version API | |
run: | | |
python ./MaaAssistantArknights/update_version.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Git config | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
- name: Add files to git | |
id: commit | |
run: | | |
git add . | |
status=$(git status --porcelain) | |
if [ -z "$status" ]; then | |
echo "Nothing to commit, working tree clean." | |
echo "working_tree_clean=true" >> $GITHUB_OUTPUT | |
exit 0 | |
else | |
echo "Found changes:" | |
git status | |
fi | |
commit_msg="chore: Update Version API" | |
git commit -m "$commit_msg" | |
- name: Push files to github | |
if: steps.commit.outputs.working_tree_clean != 'true' | |
run: | | |
git push | |
- name: Deploy | |
if: steps.commit.outputs.working_tree_clean != 'true' | |
run: | | |
gh workflow run deploy | |
env: | |
GH_TOKEN: ${{ secrets.MISTEOWORKFLOW }} |