Merge branch 'main' of https://github.com/watmildon/HighSchoolMascotMap #2
This file contains hidden or 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: Build and Run C# Program | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build-and-run: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '8.x' | |
| - name: Restore dependencies | |
| working-directory: ./newmascots | |
| run: dotnet restore | |
| - name: Build the project | |
| working-directory: ./newmascots | |
| run: dotnet build --no-restore --configuration Release | |
| - name: Run the program | |
| working-directory: ./newmascots | |
| run: dotnet run --no-build --configuration Release | |
| - name: Verify file generation | |
| run: | | |
| if [ ! -f NewMascots.txt ]; then | |
| echo "NewMascots.txt was not generated." | |
| exit 1 | |
| fi | |
| - name: Commit and push changes | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add NewMascots.txt | |
| git diff-index --quiet HEAD || git commit -m "Update NewMascots.txt" | |
| git push |