Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NuGet Packages #10

Merged
merged 5 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
GITHUB_FEED: https://nuget.pkg.github.com/Tanzy/index.json
GITHUB_USER: Tanzy
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

jobs:

Expand All @@ -27,17 +27,17 @@ jobs:
os: [ ubuntu-latest ] #, windows-latest, macos-latest ]

steps:
- name: Set up JDK 11
uses: actions/setup-java@v3
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu' # Alternative distribution options are available.
java-version: 21
distribution: 'temurin' # Alternative distribution options are available.

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch-depth is needed for GitVersion

#Install and calculate the new version with GitVersion
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.10.2
Expand All @@ -57,7 +57,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.x'
dotnet-version: '8.x'

- name: Cache SonarCloud packages
uses: actions/cache@v3
Expand All @@ -73,19 +73,19 @@ jobs:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner

- name: Install Sonar global tool
run: dotnet tool install --global dotnet-sonarscanner

- name: Install Code Coverage
run: dotnet tool install --global dotnet-coverage

- name: Restore
run: dotnet restore
run: dotnet restore

- name: Begin Sonar scan
run: dotnet sonarscanner begin /k:"Tanzy_Tanzy.Xunit" /o:"tanzy" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /v:${{ steps.gitversion.outputs.semVer }} /d:sonar.cs.vscoveragexml.reportsPaths=coverage.cobertura.xml

# Build and test
- name: Build
run: dotnet build -c Release --no-restore -p:Version=${{ steps.gitversion.outputs.semVer }}
Expand All @@ -96,20 +96,20 @@ jobs:

- name: End Sonar scan
run: dotnet sonarscanner end /d:sonar.login=${{ secrets.SONAR_TOKEN }}

- name: Pack
if: matrix.os == 'ubuntu-latest'
run: dotnet pack -v normal -c Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }} src/$PROJECT_NAME/$PROJECT_NAME.*proj
# Upload NuGet Package to Artifact store

# Upload NuGet Package to Artifact store
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: nupkg
path: ./src/${{ env.PROJECT_NAME }}/bin/Release/*.nupkg
retention-days: 5


# Label the Pull Request
label:

Expand All @@ -122,7 +122,7 @@ jobs:
- uses: actions/labeler@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

# prerelease:
# needs: build
# if: github.ref == 'refs/heads/main'
Expand All @@ -134,6 +134,6 @@ jobs:
# name: nupkg
# - name: Add GitHub Feed
# run: dotnet nuget add source --username $GITHUB_USER --password $GITHUB_TOKEN --store-password-in-clear-text --name github "$GITHUB_FEED"

# - name: Push to GitHub Feed
# run: echo "Deploy to GitHub" #dotnet nuget push ./nupkg/*.nupkg --api-key $GITHUB_TOKEN --skip-duplicate --source $GITHUB_FEED
9 changes: 9 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>
<PropertyGroup>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Newtonsoft.Json" VersionOverride="13.0.3" />
</ItemGroup>
</Project>
Loading