-
Notifications
You must be signed in to change notification settings - Fork 187
55 lines (49 loc) · 1.98 KB
/
update_packages.yml
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
51
52
53
54
55
name: Update nuget packages
on: workflow_dispatch
jobs:
update_packages:
runs-on: windows-latest
steps:
# Sync branch
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v3
# Restore packages
- name: Install dependencies ApiExamples
run: dotnet restore ./Examples/ApiExamples/ApiExamples/ApiExamples.csproj
- name: Install dependencies DocsExamples
run: dotnet restore ./Examples/DocsExamples/DocsExamples/DocsExamples.csproj
- name: Install dependencies ApiExamples.MAUI
run: dotnet restore ./Examples/ApiExamples/Runner.MAUI/Runner.MAUI.csproj
- name: Install dependencies Docker
run: dotnet restore ./Examples/DocsExamples/Docker/Docker.csproj
- name: Install dependencies DocumentExplorer
run: dotnet restore ./Examples/DocsExamples/DocumentExplorer/DocumentExplorer.csproj
# Update packages
- name: Install dotnet-outdated-tool
run: dotnet tool install --global dotnet-outdated-tool
- name: Update packages
run: |
cd Examples
OUTPUT=$(dotnet outdated -r)
if [[ $OUTPUT =~ "No outdated dependencies" ]]; then
echo "::set-output name=updated::false"
else
dotnet outdated -u -r
echo "::set-output name=updated::true"
fi
shell: bash
# Check build
- name: Build ApiExamples
run: dotnet build ./Examples/ApiExamples/ApiExamples/ApiExamples.csproj
- name: Build ApiExamples.MAUI
run: dotnet build ./Examples/ApiExamples/Runner.MAUI/Runner.MAUI.csproj
- name: Build DocsExamples
run: dotnet build ./Examples/DocsExamples/DocsExamples/DocsExamples.csproj
# Commit changes
- name: Commit changes
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Updated API versions"
git push