Skip to content

Commit 364b098

Browse files
jaybarden1jbarden
andauthored
NuGet updates and formatting (#11)
* NuGet updates and formatting * Update dotnet.yml --------- Co-authored-by: Jason Barden <[email protected]>
1 parent 7af615e commit 364b098

File tree

60 files changed

+752
-261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+752
-261
lines changed

β€Ž.github/workflows/dotnet.ymlβ€Ž

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: .NET
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ "main" ]
7+
pull_request:
8+
branches: [ "main" ]
9+
10+
jobs:
11+
build:
12+
name: Build and analyze
13+
runs-on: windows-latest
14+
permissions:
15+
contents: read
16+
env:
17+
SONAR_PROJECT: 'astar-dev-utilities'
18+
ProjectName: 'AStar.Dev.Utilities'
19+
RepositoryName: 'astar-dev-utilities'
20+
steps:
21+
- name: Set up JDK
22+
uses: actions/[email protected]
23+
with:
24+
java-version: 17
25+
distribution: 'zulu'
26+
27+
- name: Checkout
28+
uses: actions/[email protected]
29+
with:
30+
fetch-depth: 0
31+
32+
- name: πŸ›  Cache SonarQube Cloud packages
33+
uses: actions/[email protected]
34+
with:
35+
path: ~\sonar\cache
36+
key: ${{ runner.os }}-sonar
37+
restore-keys: ${{ runner.os }}-sonar
38+
39+
- name: πŸ›  Cache SonarQube Cloud scanner
40+
id: cache-sonar-scanner
41+
uses: actions/[email protected]
42+
with:
43+
path: .\.sonar\scanner
44+
key: ${{ runner.os }}-sonar-scanner
45+
restore-keys: ${{ runner.os }}-sonar-scanner
46+
47+
- name: πŸ›  Install SonarQube Cloud scanner
48+
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
49+
shell: powershell
50+
run: |
51+
New-Item -Path .\.sonar\scanner -ItemType Directory
52+
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
53+
54+
- name: πŸ” Restore, πŸ›  Build and πŸ§ͺ Test with ☁️ SonarCloud / Qube
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
58+
shell: powershell
59+
run: |
60+
dotnet tool install --global dotnet-coverage
61+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"astar-development_${{ env.SONAR_PROJECT }}" /o:"astar-development" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml /d:sonar.scanner.scanAll=false /d:sonar.scanner.skipJreProvisioning=true
62+
dotnet build --configuration Release
63+
dotnet-coverage collect 'dotnet test --filter "FullyQualifiedName!~Tests.EndToEnd"' -f xml -o 'coverage.xml'
64+
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

β€Ž.github/workflows/main_astar-dev.ymlβ€Ž

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,55 @@
11
name: SonarQube
2+
23
permissions:
34
contents: read
5+
46
on:
57
push:
68
branches:
79
- main
810
pull_request:
911
types: [ opened, synchronize, reopened ]
12+
1013
jobs:
14+
1115
build:
1216
name: Build and analyze
1317
runs-on: windows-latest
18+
1419
steps:
1520
- name: Set up JDK 17
1621
uses: actions/setup-java@v4
1722
with:
1823
java-version: 17
19-
distribution: 'zulu' # Alternative distribution options are available.
24+
distribution: 'zulu'
25+
2026
- uses: actions/checkout@v4
2127
with:
22-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
23-
- name: Cache SonarQube Cloud packages
28+
fetch-depth: 0
29+
30+
- name: πŸ›  Cache SonarQube Cloud packages
2431
uses: actions/cache@v4
2532
with:
2633
path: ~\sonar\cache
2734
key: ${{ runner.os }}-sonar
2835
restore-keys: ${{ runner.os }}-sonar
29-
- name: Cache SonarQube Cloud scanner
36+
37+
- name: πŸ›  Cache SonarQube Cloud scanner
3038
id: cache-sonar-scanner
3139
uses: actions/cache@v4
3240
with:
3341
path: .\.sonar\scanner
3442
key: ${{ runner.os }}-sonar-scanner
3543
restore-keys: ${{ runner.os }}-sonar-scanner
36-
- name: Install SonarQube Cloud scanner
44+
45+
- name: ☁️ Install SonarQube Cloud scanner
3746
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
3847
shell: powershell
3948
run: |
4049
New-Item -Path .\.sonar\scanner -ItemType Directory
4150
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
42-
- name: Build and analyze
51+
52+
- name: πŸ›  Build, πŸ§ͺ Test and analyse with ☁️ SonarCloud / Qube
4353
env:
4454
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4555
shell: powershell
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: πŸš€ Publish NuGet Package
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
env:
12+
ProjectName: 'AStar.Dev.Utilities'
13+
14+
steps:
15+
- name: 🧾 Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: πŸ›  Setup .NET
19+
uses: actions/setup-dotnet@v4
20+
with:
21+
dotnet-version: '9.x'
22+
23+
- name: πŸ” Restore dependencies
24+
run: dotnet restore
25+
26+
- name: πŸ›  Build solution
27+
run: dotnet build --configuration Release
28+
29+
- name: πŸ“¦ Pack NuGet package
30+
run: dotnet pack ./src/${{ env.ProjectName }}/${{ env.ProjectName }}.csproj --configuration Release --output ./nupkg
31+
32+
- name: πŸš€ Publish to NuGet.org
33+
run: dotnet nuget push ./nupkg/*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NuGet_API_Key }} #
34+

β€Ž.idea/.idea.AStar.Dev.Database.Testing/.idea/.nameβ€Ž

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ž.idea/.idea.DatabaseTesting/.idea/.nameβ€Ž

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
Β (0)