Upload Version Preview to NuGet #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upload Version Preview to NuGet | |
on: | |
push: | |
branches: | |
- alpha | |
tags: | |
- preview* | |
- alpha* | |
workflow_dispatch: #to test | |
jobs: | |
build: | |
env: | |
BUILD_CONFIG: Release | |
PROJECT_NAME: Rene.Utils.Core | |
VERSION_SUFFIX: preview-${{ github.run_number }} | |
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 }} --version-suffix ${{ env.VERSION_SUFFIX }} --no-restore | |
# run: dotnet build $SOLUTION_NAME --configuration $BUILD_CONFIG | |
- name: Test | |
run: dotnet test $TEST_PROJECT_PATH --no-restore --verbosity normal | |
- name: dotnet pack [$PROJECT_NAME] | |
# run: dotnet pack $PROJECT_PATH -c ${{ env.BUILD_CONFIG }} --version-suffix $VERSION_SUFFIX --include-source --include-symbols -p:SymbolPackageFormat=snupkg -o ./artifacts | |
run: dotnet pack $PROJECT_PATH -c ${{ env.BUILD_CONFIG }} --version-suffix ${{ env.VERSION_SUFFIX }} --include-source --include-symbols -p:SymbolPackageFormat=snupkg -o ./artifacts | |
- name: Publish NuGet | |
run: dotnet nuget push ./artifacts/*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate | |