Skip to content

Merge pull request #39 from renepacios/main #80

Merge pull request #39 from renepacios/main

Merge pull request #39 from renepacios/main #80

Workflow file for this run

name: Upload Version to NuGet
on:
push:
tags:
- v*
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
env:
BUILD_CONFIG: Release
PROJECT_NAME: Rene.Utils.Core
name: Build Start Enviroment
runs-on: ubuntu-latest
strategy:
matrix:
dotnet: [ '8.0.x']
steps:
- name: Set env. aux vars
run: |
echo "SOLUTION_NAME=${PROJECT_NAME}.sln">> $GITHUB_ENV
echo "TEST_PROJECT_PATH=tests/${PROJECT_NAME}.UnitTest/${PROJECT_NAME}.UnitTest.csproj" >> $GITHUB_ENV
echo "PROJECT_PATH=src/${PROJECT_NAME}/${PROJECT_NAME}.csproj" >> $GITHUB_ENV
- uses: actions/checkout@v2
- name: Setup .NET Core ${{ matrix.dotnet }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Install dependencies
run: dotnet restore $SOLUTION_NAME
- name: Build
run: dotnet build $PROJECT_PATH -c ${{ env.BUILD_CONFIG }} --no-restore
- name: Test
run: dotnet test $TEST_PROJECT_PATH --no-restore --verbosity normal
#- name: dotnet pack [$PROJECT_NAME]
# run: dotnet pack $PROJECT_PATH -c $BUILD_CONFIG --no-build --include-source --include-symbols -o ./artifacts
- name: Publish NuGet
uses: brandedoutcast/[email protected]
id: publish_nuget
with:
# Filepath of the project to be packaged, relative to root of repository
PROJECT_FILE_PATH: src/Rene.Utils.Core/Rene.Utils.Core.csproj
# NuGet package id, used for version detection & defaults to project name
PACKAGE_NAME: Rene.Utils.Core
# Filepath with version info, relative to root of repository & defaults to PROJECT_FILE_PATH
VERSION_FILE_PATH: Directory.Build.props
# Regex pattern to extract version info in a capturing group
VERSION_REGEX: ^\s*<VersionPrefix>(.*)<\/VersionPrefix>\s*$
# Useful with external providers like Nerdbank.GitVersioning, ignores VERSION_FILE_PATH & VERSION_REGEX
# VERSION_STATIC: 1.0.0
# Flag to toggle git tagging, enabled by default
TAG_COMMIT: true
# Format of the git tag, [*] gets replaced with actual version
TAG_FORMAT: v*
# API key to authenticate with NuGet server
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
# NuGet server uri hosting the packages, defaults to https://api.nuget.org
# NUGET_SOURCE: https://api.nuget.org
# Flag to toggle pushing symbols along with nuget package to the server, disabled by default
# INCLUDE_SYMBOLS: false