Skip to content

Commit

Permalink
Merge pull request #4 from vitalybibikov/vitalybibikov-patch-1
Browse files Browse the repository at this point in the history
Update dotnet.yml
  • Loading branch information
vitalybibikov authored Apr 16, 2024
2 parents 97e8777 + ad39447 commit 8c5d70d
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ on:
branches: [ "master", "development" ]
pull_request:
branches: [ "master", "development" ]

release:
types:
- published # Run the workflow when a new GitHub release is published

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
NuGetDirectory: ${{github.workspace}}/nupkgs

jobs:
integration-tests:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -85,17 +93,25 @@ jobs:
uses: actions/checkout@v3

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Build and Pack
run: |
dotnet build src/DynamoDBv2.Transactions.csproj --configuration Release
dotnet pack src/DynamoDBv2.Transactions.csproj --configuration Release --output ./nupkgs /p:Version=3.7.$GITHUB_RUN_NUMBER
dotnet pack src/DynamoDBv2.Transactions.csproj --configuration Release --output ${{ env.NuGetDirectory }} /p:Version=3.7.$GITHUB_RUN_NUMBER
- name: Publish NuGet Package
uses: rohith/publish-nuget@v2
- name: Create NuGet Artifact
- uses: actions/upload-artifact@v3
with:
package_path: ./nupkgs/*.nupkg
nuget_key: ${{ secrets.NUGET_PUSH_KEY }}
name: nuget
if-no-files-found: error
retention-days: 7
path: ${{ env.NuGetDirectory }}/*.nupkg

- name: Publish NuGet package
run: |
foreach($file in (Get-ChildItem ${{ env.NuGetDirectory }} -Recurse -Include *.nupkg)) {
dotnet nuget push $file --api-key "${{ secrets.NUGET_PUSH_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
}

0 comments on commit 8c5d70d

Please sign in to comment.