Skip to content
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/checkout@v2.5.0

- 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}}