Files
AspNetCore.Identity.MongoDb…/.github/workflows/nuget-ci.yml
T
2024-11-25 21:55:13 +01:00

37 lines
1.4 KiB
YAML

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
env:
PACKAGE_VERSION: ${GITHUB_REF/refs\/tags\/v/}
PACKAGE_OWNER: ${{ github.repository_owner }}
PACKAGE_NAME: AspNetCore.Identity.MongoDbCore.${{ env.PACKAGE_VERSION }}.nupkg
PACKAGE_SOURCE: https://git.home.cuco.li/api/packages/${{ env.PACKAGE_OWNER }}/nuget/index.json
PACKAGE_TOKEN: ${{ github.token }}
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v2
- 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: Set VERSION variable from tag
# run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Setup .NET
uses: https://github.com/actions/setup-dotnet@v4
- 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
run: dotnet pack --configuration Release /p:Version=${{ env.PACKAGE_VERSION }} --no-build --output .
- name: Push
run: dotnet nuget push ${{ env.PACKAGE_NAME }} --source ${{ env.PACKAGE_SOURCE }} --api-key ${GITHUB_TOKEN}
env:
GITHUB_TOKEN: ${{ env.PACKAGE_TOKEN }}