diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ca83aed --- /dev/null +++ b/.github/workflows/main.yml @@ -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/\(\([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}}