MTG.Objects.Generator Runner #849
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: MTG.Objects.Generator Runner | |
on: | |
schedule: | |
- cron: '37 4 * * *' | |
workflow_dispatch: | |
inputs: | |
reason: | |
description: 'The reason for running the workflow' | |
required: true | |
default: 'Manual build from GitHub UI' | |
jobs: | |
generate: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
working-directory: ./src/MTG.Object.Generator | |
- name: Build | |
run: dotnet build --no-restore | |
working-directory: ./src/MTG.Object.Generator | |
- name: Generate | |
run: dotnet run | |
working-directory: ./src/MTG.Object.Generator | |
- name: Commit generated files | |
run: | | |
if [ -n "$(git status --porcelain)" ]; then | |
git config --global user.name 'Mark Gottselig' | |
git config --global user.email '[email protected]' | |
git add src/MTG.Objects | |
git commit -am "Automated code generation" | |
git push | |
else | |
echo "No changes detected" | |
fi |