Skip to content
Merged
Show file tree
Hide file tree
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
73 changes: 73 additions & 0 deletions .github/workflows/MergeToMain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Merge Pull Requests into 'main'

on:
push:
branches: [main]

permissions:
packages: write

env:
DOTNET_NOLOGO: true

jobs:
build_and_create_a_nuget:
name: Package a NuGet to GPR
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build version prefix/suffix
run: |
echo "VERSION_PREFIX=$(( 100 + ${{ github.run_number }} )).0.0" >> $GITHUB_ENV
echo "VERSION_SUFFIX=beta" >> $GITHUB_ENV

- name: Setup .NET
uses: actions/setup-dotnet@v3

- name: Dotnet Restore
run: dotnet restore --verbosity minimal

- name: Dotnet Build
run: dotnet build --configuration Release -p:ContinuousIntegrationBuild=true -p:DebugType=Embedded -p:VersionPrefix=$VERSION_PREFIX --version-suffix $VERSION_SUFFIX

- name: Dotnet Test
run: dotnet test --configuration Release --no-build

- name: Dotnet Pack
run: dotnet pack --configuration Release --no-build --output ./artifacts -p:DebugType=Embedded -p:VersionPrefix=$VERSION_PREFIX --version-suffix $VERSION_SUFFIX

- name: Publish artifacts
uses: actions/upload-artifact@v3
with:
name: NuGetPackage.${{ env.VERSION_PREFIX }}-${{ env.VERSION_SUFFIX }}
path: ./artifacts/

- name: Publish to GPR
run: |
dotnet nuget push "./artifacts/*.nupkg" \
--no-symbols \
--api-key ${{ secrets.GITHUB_TOKEN }} \
--source https://nuget.pkg.github.com/${{ github.repository_owner }}

test:
name: Buid and Test (DEBUG)
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3

- name: Dotnet Restore
run: dotnet restore --verbosity minimal

- name: Dotnet Build
run: dotnet build --configuration Debug

- name: Dotnet Test
run: dotnet test --configuration Debug --verbosity minimal --no-build --collect:"XPlat Code Coverage" --results-directory "./.codecoverage"
61 changes: 61 additions & 0 deletions .github/workflows/PullRequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Pull Request

on: pull_request

env:
DOTNET_NOLOGO: true

jobs:

build_and_test_debug:
name: Build and Test (DEBUG)
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3

- run: dotnet restore --verbosity minimal

- run: dotnet build --configuration Debug /p:ContinuousIntegrationBuild=true

- run: dotnet test --configuration Debug --verbosity minimal --no-build --collect:"XPlat Code Coverage" --results-directory "./.codecoverage"

- name: Code coverage
uses: codecov/codecov-action@v3
with:
directory: "./.codecoverage"
fail_ci_if_error: true

build_test_pack_release:
name: Build, Test and Pack (RELEASE)
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build version prefix/suffix
run: |
echo "VERSION_PREFIX=$(( 100 + ${{ github.run_number }} )).0.0" >> $GITHUB_ENV
echo "VERSION_SUFFIX=alpha" >> $GITHUB_ENV

- name: Setup .NET
uses: actions/setup-dotnet@v3

- run: dotnet restore --verbosity minimal

- run: dotnet build --configuration Release -p:ContinuousIntegrationBuild=true -p:DebugType=Embedded -p:VersionPrefix=$VERSION_PREFIX --version-suffix $VERSION_SUFFIX

- run: dotnet test --configuration Release --no-build

- run: dotnet pack --configuration Release --no-build --output ./artifacts -p:DebugType=Embedded -p:VersionPrefix=$VERSION_PREFIX --version-suffix $VERSION_SUFFIX

- name: Publish artifacts
uses: actions/upload-artifact@v3
with:
name: NuGetPackage.${{ env.VERSION_PREFIX }}-${{ env.VERSION_SUFFIX }}
path: ./artifacts/
65 changes: 65 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish to Nuget.org and GPR

on:
push:
tags:
- "v*.*.*"
- "*.*.*"

permissions:
contents: write
packages: write

env:
DOTNET_NOLOGO: true

jobs:
build_and_create_a_nuget:
name: Package a NuGet to NuGet.org
runs-on: ubuntu-latest
steps:

- name: Calculate version from the Commit Tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Checkout repository
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3

- name: Dotnet Restore
run: dotnet restore --verbosity minimal

- name: Dotnet Build
run: dotnet build --configuration Release -p:ContinuousIntegrationBuild=true -p:DebugType=Embedded -p:version=${{ env.RELEASE_VERSION }}

- name: Dotnet Pack
run: dotnet pack --configuration Release --no-build --output ./artifacts -p:DebugType=Embedded -p:version=${{ env.RELEASE_VERSION }}

- name: Publish artifacts
uses: actions/upload-artifact@v3
with:
name: NuGetPackage.${{ env.RELEASE_VERSION }}
path: ./artifacts/

- name: Upload release assets
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: NuGetPackage.${{ env.RELEASE_VERSION }}
files: ./artifacts/*

- name: Publish to GPR
run: |
dotnet nuget push "./artifacts/*.nupkg" \
--no-symbols \
--api-key ${{ secrets.GITHUB_TOKEN }} \
--source https://nuget.pkg.github.com/${{ github.repository_owner }}

- name: Publish to nuget.org
run: |
dotnet nuget push "./artifacts/*.nupkg" \
--api-key ${{ secrets.NUGET_TOKEN }} \
--source https://api.nuget.org/v3/index.json
40 changes: 0 additions & 40 deletions AppVeyor/appveyor-master.yml

This file was deleted.

38 changes: 0 additions & 38 deletions AppVeyor/appveyor.yml

This file was deleted.