Last active
March 20, 2020 16:12
-
-
Save skolima/ee22e2de7a8a013fb569755b0ae1a749 to your computer and use it in GitHub Desktop.
Run dotnet test; if on branch master, also build and publish NuGet package to GitHub Package Registry
This file contains hidden or 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: Run .NET Core tests | |
on: [push] | |
jobs: | |
build: | |
name: Build and test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-dotnet@v1 | |
- run: dotnet test | |
nuget-publish: | |
name: Publish package to GPR | |
runs-on: ubuntu-latest | |
needs: build | |
if: contains(github.ref, 'master') | |
steps: | |
- uses: einaregilsson/build-number@v2 | |
id: buildnumber | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-dotnet@v1 | |
with: | |
source-url: https://nuget.pkg.github.com/YOUR_ORGANIZATION/index.json | |
env: | |
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- run: dotnet pack --configuration Release /p:Version=1.1.0.$BUILD_NUMBER --output $GITHUB_WORKSPACE | |
- run: dotnet nuget push $GITHUB_WORKSPACE/*.nupkg | |
- uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: 1.1.0.${{ steps.buildnumber.outputs.build_number }} | |
release_name: Release 1.1.0.${{ steps.buildnumber.outputs.build_number }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment