Skip to content

Commit

Permalink
build to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelmathot committed Mar 31, 2021
1 parent adffa00 commit d863458
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 40 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: dotnet build

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x' #${{ matrix.dotnet-version }}
- name: Install dependencies
run: dotnet restore src
- name: Build
run: dotnet build src --configuration Release --no-restore
- name: Test
run: dotnet test src --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
- name: Upload test results
uses: actions/upload-artifact@v2
with:
name: dotnet-results-${{ matrix.dotnet-version }}
path: TestResults-${{ matrix.dotnet-version }}
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
24 changes: 24 additions & 0 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: dotnet package

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x' # SDK Version to use.
# source-url: https://nuget.pkg.github.com/<owner>/index.json

- run: dotnet build src
- name: Create the package
run: dotnet pack src/ -c release --include-symbols -o publish
- name: Publish the package to Nuget
run: dotnet nuget push publish/*.nupkg -s https://www.nuget.org/api/v2/package -k ${{secrets.NUGET_API_KEY}} --skip-duplicate
- name: Publish the package to GPR
run: dotnet nuget push publish/*.nupkg -s https://nuget.pkg.github.com/Terradue/index.json -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate

40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

0 comments on commit d863458

Please sign in to comment.