diff --git a/.github/workflows/dotnet-main.yml b/.github/workflows/dotnet-main.yml index f66dcdb..3d84739 100644 --- a/.github/workflows/dotnet-main.yml +++ b/.github/workflows/dotnet-main.yml @@ -6,7 +6,7 @@ on: push: branches: [ "main" ] permissions: - contents: read + contents: write issues: read checks: write pull-requests: write @@ -81,14 +81,18 @@ jobs: run: cat ./coverage-results/Summary.md >> $GITHUB_STEP_SUMMARY - name: Create package - run: dotnet pack --no-restore --nologo --no-build -p:PackageOutputPath='./publish' -c Release -p:PackageVersion=${NBGV_SimpleVersion} -p:PublicRelease=true -p:SymbolPackageFormat=snupkg --include-symbols --include-source + run: dotnet pack --no-restore --nologo --no-build -p:PackageOutputPath='./publish' -c Release -p:PackageVersion=${NBGV_NuGetPackageVersion} -p:PublicRelease=true -p:SymbolPackageFormat=snupkg --include-symbols --include-source - - name: Upload publish artifacts - uses: actions/upload-artifact@v3 + - name: Publish nuget packages + run: dotnet nuget push "**/publish/*.nupkg" -s 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}} + + - name: Create tag + run: ngbv tag v${NBGV_NuGetPackageVersion} + + - uses: ncipollo/release-action@v1 with: - name: upload artifacts - path: '**/publish/*' + tag: v${NBGV_SimpleVersion} + generateReleaseNotes: true + - - name: Publish nuget packages - run: dotnet nuget push "**/publish/*.nupkg" -s 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}} --skip-duplicate diff --git a/.github/workflows/dotnet-pr.yml b/.github/workflows/dotnet-pr.yml index c50fe5a..a80b7f2 100644 --- a/.github/workflows/dotnet-pr.yml +++ b/.github/workflows/dotnet-pr.yml @@ -23,10 +23,6 @@ jobs: with: dotnet-version: '8.0.x' - - name: retrieve version - uses: dotnet/nbgv@master - id: nbgv - - name: install run: dotnet restore diff --git a/version.json b/version.json index 8fdfbb2..be44cc8 100644 --- a/version.json +++ b/version.json @@ -1,11 +1,11 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "1.0.0", + "version": "1.0", + "gitCommitIdShortAutoMinimum": 7, + "nugetPackageVersion": { + "semVer": 2 + }, "publicReleaseRefSpec": [ - "^refs/heads/master$", - "^refs/heads/v\\d+(?:\\.\\d+)?$" - ], - "release": { - "branchName": "release/v{version}" - } + "^refs/heads/main$" + ] }