From de8fe25a73c0b9ab85ed89d3c3c5a851ebae6cf8 Mon Sep 17 00:00:00 2001 From: FiniteReality Date: Tue, 7 Apr 2020 22:31:37 +0100 Subject: [PATCH] Add CI support based on GitHub actions --- .editorconfig | 2 +- .github/workflows/build.yml | 36 ++++++++++++++++++++++++++++++++++++ Directory.Build.props | 14 ++++++++++++-- Directory.Build.targets | 2 +- 4 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.editorconfig b/.editorconfig index 923f6c87f..a6bb14e35 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,7 +8,7 @@ indent_style = space indent_size = 4 trim_trailing_whitespace = true -[*.{cmd,config,csproj,cxxproj,json,props,ps1,resx,sh,targets}] +[*.{cmd,config,csproj,cxxproj,json,props,ps1,resx,sh,targets,yml}] indent_size = 2 [*.sln] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..f40777ee4 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +name: Build using .NET Core + +on: + push: + branches: [ 3.0 ] + paths-ignore: + - 'docs/**' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.3 + + - name: Install dependencies + run: dotnet restore + + - name: Build Discord.Net + run: dotnet build --configuration Release --no-restore + + - name: Run Unit Tests + run: dotnet test --no-restore --verbosity normal + + - name: Pack Discord.Net + run: dotnet pack --configuration Release + + - name: Upload Artifacts + uses: actions/upload-artifact@v1.0.0 + with: + name: nupkgs + path: $GITHUB_WORKSPACE/artifacts/pkg/ diff --git a/Directory.Build.props b/Directory.Build.props index d4e460491..a9566f0ca 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -12,6 +12,11 @@ that is done by the file that imports us. --> + + + $([System.String]::Copy('$(GITHUB_REF)').Replace('refs/pull/', '').Replace('/merge', '')) + + $(MSBuildThisFileDirectory)artifacts/ @@ -45,7 +50,7 @@ Discord.Net 3.0.0 alpha - pr$(SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) + pr$(PullRequestNumber) @@ -59,7 +64,7 @@ 4.3 en-US true - https://github.com/Discord-Net/Discord.Net/raw/dev/docs/marketing/logo/PackageLogo.png + PackageLogo.png MIT $(RepositoryUrl) git @@ -69,6 +74,11 @@ true + + + + + true diff --git a/Directory.Build.targets b/Directory.Build.targets index 4d527ca9a..6e7b0d1aa 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -16,7 +16,7 @@ $(DefineConstants);$(OS) $(NoWarn);NU5105 - $(Version).$(BUILD_BUILDNUMBER) + $(Version).$(GITHUB_RUN_ID)