Update .github/workflows/nuget-ci.yml

This commit is contained in:
2024-11-26 22:17:37 +01:00
parent 6c33537060
commit 68ce5b04d9
+11 -3
View File
@@ -1,12 +1,12 @@
on: on:
push: push:
tags: tags:
- "v[0-9]+.[0-9]+.[0-9]+-preview[0-9][0-9][0-9]" - "v[0-9]+.[0-9]+.[0-9]+"
env: env:
PACKAGE_VERSION: ${GITHUB_REF/refs\/tags\/v/} PACKAGE_VERSION: ${GITHUB_REF/refs\/tags\/v/}
PACKAGE_OWNER: ${{ github.repository_owner }} PACKAGE_OWNER: ${{ github.repository_owner }}
PACKAGE_NAME: AspNetCore.Identity.MongoDbCore.${{ env.PACKAGE_VERSION }}.nupkg PACKAGE_NAME: MongoDbGenericRepository.${{ env.PACKAGE_VERSION }}.nupkg
PACKAGE_SOURCE: https://git.home.cuco.li/api/packages/${{ env.PACKAGE_OWNER }}/nuget/index.json PACKAGE_SOURCE: https://git.home.cuco.li/api/packages/${{ env.PACKAGE_OWNER }}/nuget/index.json
PACKAGE_TOKEN: ${{ secrets.PACKAGE_PUSH_TOKEN }} PACKAGE_TOKEN: ${{ secrets.PACKAGE_PUSH_TOKEN }}
@@ -19,7 +19,15 @@ jobs:
- uses: actions/setup-dotnet@v4 - uses: actions/setup-dotnet@v4
with: with:
dotnet-version: '8.x.x' dotnet-version: '8.x.x'
- name: Verify commit exists in origin/master
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/master
- name: Build
run: dotnet build --configuration Release /p:Version=${{ env.PACKAGE_VERSION }}
- name: Test
run: dotnet test --configuration Release /p:Version=${{ env.PACKAGE_VERSION }} --no-build
- name: Pack - name: Pack
run: dotnet pack --configuration Release /p:Version=${{ env.PACKAGE_VERSION }} --output . run: dotnet pack --configuration Release /p:Version=${{ env.PACKAGE_VERSION }} --no-build --output .
- name: Push - name: Push
run: dotnet nuget push ${{ env.PACKAGE_NAME }} --source ${{ env.PACKAGE_SOURCE }} --api-key ${{ env.PACKAGE_TOKEN }} run: dotnet nuget push ${{ env.PACKAGE_NAME }} --source ${{ env.PACKAGE_SOURCE }} --api-key ${{ env.PACKAGE_TOKEN }}