Files
MaaAssistantArknights/.github/workflows/res-update-game.yml

61 lines
2.1 KiB
YAML

name: res-update-game
on:
# schedule:
# - cron: "*/20 * * * *"
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"
if ($LASTEXITCODE) { exit $LASTEXITCODE }
git pull origin $(git rev-parse --abbrev-ref HEAD) --unshallow --rebase
- name: Push changes # push the output folder to your repo
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Testing and Release # ref: https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
run: |
gh workflow run test
gh workflow run release-nightly-ota -f release_body="Auto Release of Resource Updates"
env:
GH_TOKEN: ${{ github.token }}