chore: 通过 CI 更新游戏资源

This commit is contained in:
MistEO
2023-04-27 18:18:48 +08:00
parent 98943e588b
commit 6ba80dd6bc
3 changed files with 75 additions and 10 deletions

51
.github/workflows/res-update-game.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: res-update-game
on:
workflow_dispatch:
inputs:
commit_message:
description: 'Commit Message'
type: string
required: false
jobs:
update-game-resources:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Bootstrap MaaDeps
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python3 maadeps-download.py x64-windows
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Build Resource Updater
run: |
MSBUILD tools/ResourceUpdater/ResourceUpdater.vcxproj /t:rebuild /p:Configuration="Release" /p:Platform="x64" /p:BuildProjectReferences=false /m
- name: Run Resource Updater
run: |
.\tools\ResourceUpdater\x64\Release\ResourceUpdater.exe
- name: Add files to git
run: |
git status
git config user.name "$env:GITHUB_ACTOR"
git config user.email "$env:GITHUB_ACTOR@users.noreply.github.com"
git add .
$commit_msg = "${{ github.event.inputs.commit_message }}"
if (-not [string]::IsNullOrWhiteSpace($commit_msg)) {
$commit_msg = $commit_msg.Trim()
} else {
$commit_msg = "chore: Auto Update Game Resources - $(Get-Date -Format 'yyyy-MM-dd')"
}
git commit -m "$commit_msg"
git pull --rebase
- name: Push changes # push the output folder to your repo
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force: false