File tree Expand file tree Collapse file tree 3 files changed +51
-13
lines changed
Expand file tree Collapse file tree 3 files changed +51
-13
lines changed Original file line number Diff line number Diff line change 11name : CI
22on :
33 push :
4- pull_request :
5-
4+ branches : [ dev ]
5+ paths :
6+ - " **/*.csproj"
7+ - " Directory.Build.props"
8+ - " .github/workflows/ci.yml"
69jobs :
7- build-test :
10+ pack-and-push :
811 runs-on : ubuntu-latest
12+ permissions :
13+ contents : read
14+ packages : write
15+
916 steps :
1017 - uses : actions/checkout@v4
11- - uses : actions/setup-dotnet@v4
12- with :
13- dotnet-version : 9.0.304
14- - name : Cache NuGet
15- uses : actions/cache@v4
18+ - name : Setup .NET
19+ uses : actions/setup-dotnet@v4
1620 with :
17- path : ~/.nuget/packages
18- key : nuget-${{ runner.os }}-${{ hashFiles('**/packages.lock.json', '**/*.csproj', '**/global.json') }}
19- - run : dotnet restore
20- - run : dotnet build --configuration Release --no-restore
21- - run : dotnet test --configuration Release --no-build --collect:"XPlat Code Coverage"
21+ dotnet-version : ' 9.0.304'
22+ - name : Set VERSION sufix for CI
23+ run : echo "VERSION_SUFFIX=-ci-$(date +'%Y%m%d%H%M%S').${{ github.run_number }}" >> $GITHUB_ENV
24+ - name : Restore dependencies
25+ run : dotnet restore
26+ - name : Build
27+ run : dotnet build --no-restore --configuration Release
28+ - name : Add GitHub Packages as a NuGet source
29+ run : |
30+ dotnet nuget add source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
31+ --name "github" \
32+ --username "${{ github.actor }}" \
33+ --password "${{ secrets.GITHUB_TOKEN }}" \
34+ --store-password-in-clear-text \
35+ || true
36+ - name : Pack and push NuGet packages
37+ run : |
38+ for nupkg in ./artifacts/*.nupkg; do
39+ dotnet nuget push "$nupkg" --source "github" --skip-duplicate;
40+ done
Original file line number Diff line number Diff line change 1+ <Project >
2+ <Target Name =" CopyReadme" AfterTargets =" Pack" >
3+ <Copy SourceFiles =" README.md" DestinationFolder =" $(OutputPath)" />
4+ </Target >
5+ </Project >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <configuration >
3+ <packageSources >
4+ <add key =" github" value =" https://nuget.pkg.github.com/TaskHub-Server/index.json" />
5+ <add key =" nuget.org" value =" https://api.nuget.org/v3/index.json" />
6+ </packageSources >
7+
8+ <packageSourceCredentials >
9+ <github >
10+ <add key =" Username" value =" andrey-serdyuk" />
11+ <add key =" Password" value =" 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" />
12+ </github >
13+ </packageSourceCredentials >
14+ </configuration >
You can’t perform that action at this time.
0 commit comments