-
Notifications
You must be signed in to change notification settings - Fork 9
50 lines (40 loc) · 1.16 KB
/
newmascots.yml
File metadata and controls
50 lines (40 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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