mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-20 02:55:38 +08:00
chore: 通过 CI 更新游戏资源
This commit is contained in:
51
.github/workflows/res-update-game.yml
vendored
Normal file
51
.github/workflows/res-update-game.yml
vendored
Normal 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
|
||||
Reference in New Issue
Block a user