Skip to content

Github Action - Publish package and symbols to nuget #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: PublishToNugetWithSymbols

on:
create:
branches:
- release/**
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:

env:
BUILD_CONFIG: 'Release'
SOLUTION: 'Testura.Code.sln'

runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]

- name: Increment Build Version (patch number only)
run: |
sed -i "s/\(<Version>\([0-9]\+\.\)\{2\}\)\([0-9]\+\)/\1${{github.run_number}}/" /src/Testura.Code.csproj

- name: Restore dependencies
run: nuget restore $SOLUTION

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.100

# - name: Build
# run: dotnet build $SOLUTION --configuration $BUILD_CONFIG -p:Version=$BUILD_VERSION --no-restore

# - name: Run tests
# run: dotnet test /p:Configuration=$env:BUILD_CONFIG --no-restore --no-build --verbosity normal

# - name: Pack
# run: dotnet pack /src/Testura.Code.csproj -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg

# - name: Publish Package and Symbols
# if: startsWith(github.ref, 'refs/heads/release')
# run: |
# nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_PUBLISH_KEY}}
# nuget push **\*.snupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_PUBLISH_KEY}}