diff --git a/.github/workflows/myget-feature-deploy.yml b/.github/workflows/myget-feature-deploy.yml new file mode 100644 index 00000000..d0b1879c --- /dev/null +++ b/.github/workflows/myget-feature-deploy.yml @@ -0,0 +1,29 @@ +name: Build and package feature branch. Deploy to MyGet + +on: + push: + branches: + - 'feature/**' + +jobs: + build-test-package: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + with: + fetch-depth: 0 + + - name: Setup .NET Core SDK + uses: actions/setup-dotnet@master + with: + dotnet-version: '3.1.x' + + - name: Build with dotnet + run: dotnet build --configuration Release + + - name: Generate nuget package + run: dotnet pack --configuration Release -o nupkg + + - name: Push packages + run: dotnet nuget push './nupkg/*.nupkg' --api-key ${{secrets.MYGET_APIKEY}} --source https://www.myget.org/F/etherna/api/v3/index.json diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/myget-stable-deploy.yml similarity index 91% rename from .github/workflows/build-test-package.yml rename to .github/workflows/myget-stable-deploy.yml index 55bab03c..a8346b09 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/myget-stable-deploy.yml @@ -1,4 +1,4 @@ -name: Build test and package .Net Core library - MongODM +name: Build test and package dev and master branch. Deploy to MyGet on: push: diff --git a/.github/workflows/nuget-release-deploy.yml b/.github/workflows/nuget-release-deploy.yml new file mode 100644 index 00000000..c5fd3b0f --- /dev/null +++ b/.github/workflows/nuget-release-deploy.yml @@ -0,0 +1,31 @@ +name: Build test and package master branch. Deploy to NuGet + +on: + push: + branches: master + +jobs: + build-test-package: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + with: + fetch-depth: 0 + + - name: Setup .NET Core SDK + uses: actions/setup-dotnet@master + with: + dotnet-version: '3.1.x' + + - name: Build with dotnet + run: dotnet build --configuration Release + + - name: Run unit tests + run: dotnet test --configuration Release + + - name: Generate nuget package + run: dotnet pack --configuration Release -o nupkg + + - name: Push packages + run: dotnet nuget push './nupkg/*.nupkg' --api-key ${{secrets.NUGET_KEY}} --source https://api.nuget.org/v3/index.json diff --git a/MongODM.sln b/MongODM.sln index 7fa3b3a5..1bec69e7 100644 --- a/MongODM.sln +++ b/MongODM.sln @@ -26,7 +26,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{D4BB5972-5F7B-43ED-81C1-69ECF0E62D1E}" ProjectSection(SolutionItems) = preProject - .github\workflows\build-test-package.yml = .github\workflows\build-test-package.yml + .github\workflows\myget-feature-deploy.yml = .github\workflows\myget-feature-deploy.yml + .github\workflows\myget-stable-deploy.yml = .github\workflows\myget-stable-deploy.yml + .github\workflows\nuget-release-deploy.yml = .github\workflows\nuget-release-deploy.yml EndProjectSection EndProject Global