-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (58 loc) · 2.8 KB
/
package.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Trunk - build and package actions
on:
push:
branches:
- main
- trunk
jobs:
build_and_pack_DataAccess:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
# Set up local NuGet repo
- name: Setup GitHub NuGet
run: dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Ian-Webster/index.json"
- name: Check for Changes in Repository Project
run: |
if [[ $(git diff --name-only ${{ github.event.before }} ${{ github.sha }} 'DataAccess.Repository/') ]]; then
echo "Changes detected in DataAccess.Repository project. Restoring packages and running build..."
dotnet restore 'DataAccess.Repository'
dotnet build --configuration Release 'DataAccess.Repository'
dotnet test 'DataAccess.Repository.Tests'
dotnet nuget push "DataAccess.Repository/bin/Release/*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source "github" --skip-duplicate
else
echo "No changes in DataAccess.Repository project. Skipping build and packing"
fi
build_and_pack_HotChococlateExtension:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
# Set up local NuGet repo
- name: Setup GitHub NuGet
run: dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Ian-Webster/index.json"
- name: Check for Changes in HotChocolate Project
run: |
if [[ $(git diff --name-only ${{ github.event.before }} ${{ github.sha }} 'Extensions/DataAccess.Repository.HotChocolate/') ]]; then
echo "Changes detected in Extensions/DataAccess.Repository.HotChocolate project. Restoring packages and running build..."
dotnet restore 'Extensions/DataAccess.Repository.HotChocolate'
dotnet build --configuration Release 'Extensions/DataAccess.Repository.HotChocolate'
dotnet nuget push "Extensions/DataAccess.Repository.HotChocolate/bin/Release/*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source "github" --skip-duplicate
else
echo "No changes in Extensions/DataAccess.Repository.HotChocolate project. Skipping build and packing"
fi