Skip to content

Commit

Permalink
🔀 Merge branch main into dotnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Lamparter committed Sep 28, 2024
1 parent 253a5b0 commit 7607fa1
Show file tree
Hide file tree
Showing 1,715 changed files with 388 additions and 266 deletions.
File renamed without changes.
File renamed without changes.
80 changes: 44 additions & 36 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,69 @@
name: Build, test and publish
"on":

on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '*.md'
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
- '*.md'
workflow_dispatch:

env:
config: Release
PackageOutputPath: nupkg
CONFIGURATION: "Release"
ARTIFACTS_STAGING_DIR_PATH: "nupkg"
OG_SOLUTION_PATH: "Octokit.GraphQL.sln"
OG_UNIT_TESTS_PROJ_PATH: ".\\src\\Octokit.GraphQL.UnitTests\\Octokit.GraphQL.UnitTests.csproj"
OG_CORE_UNIT_TESTS_PROJ_PATH: ".\\src\\Octokit.GraphQL.Core.UnitTests\\Octokit.GraphQL.Core.UnitTests.csproj"
OG_CORE_GENERATOR_UNIT_TESTS_PROJ_PATH: ".\\src\\Octokit.GraphQL.Core.Generation.UnitTests\\Octokit.GraphQL.Core.Generation.UnitTests.csproj"
OG_PACK_PROJ_PATH: ".\\src\\Octokit.GraphQL.Pack\\Octokit.GraphQL.Pack.csproj"

jobs:
build-test-publish:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core and GitHub Packages
uses: actions/setup-dotnet@v1

- name: Checkout the repository
uses: actions/checkout@v4
- name: Setup .NET & GitHub Packages
uses: actions/setup-dotnet@v4
with:
dotnet-version: 3.1.101
source-url: https://nuget.pkg.github.com/octokit/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup NuGet
uses: nuget/setup-nuget@v1
with:
nuget-version: 5.x
- name: Build using .NET Core
run: dotnet build Octokit.GraphQL.sln -c ${{ env.config }}
uses: nuget/setup-nuget@v2

- name: Build the solution
run: dotnet build ${{ env.OG_SOLUTION_PATH }} -c ${{ env.CONFIGURATION }}

- name: Run Octokit.GraphQL.UnitTests
run: >-
dotnet test -c ${{ env.config }} --no-build
.\Octokit.GraphQL.UnitTests\Octokit.GraphQL.UnitTests.csproj
run: dotnet test -c ${{ env.CONFIGURATION }} --no-build ${{ env.OG_UNIT_TESTS_PROJ_PATH }}

- name: Run Octokit.GraphQL.Core.UnitTests
run: >-
dotnet test -c ${{ env.config }} --no-build
.\Octokit.GraphQL.Core.UnitTests\Octokit.GraphQL.Core.UnitTests.csproj
run: dotnet test -c ${{ env.CONFIGURATION }} --no-build ${{ env.OG_CORE_UNIT_TESTS_PROJ_PATH }}

- name: Run Octokit.GraphQL.Core.Generation.UnitTests
run: >-
dotnet test -c ${{ env.config }} --no-build
.\Octokit.GraphQL.Core.Generation.UnitTests\Octokit.GraphQL.Core.Generation.UnitTests.csproj
- name: Create package using .nuspec
run: >-
dotnet pack Octokit.GraphQL.Pack/Octokit.GraphQL.Pack.csproj --output
${{ env.PackageOutputPath }}
- name: Upload nupkg artifact
uses: actions/upload-artifact@v2
run: dotnet test -c ${{ env.CONFIGURATION }} --no-build ${{ env.OG_CORE_GENERATOR_UNIT_TESTS_PROJ_PATH }}

- name: Create the new package
run: dotnet pack ${{ env.OG_PACK_PROJ_PATH }} -o ${{ env.ARTIFACTS_STAGING_DIR_PATH }}

- name: Publish to GitHub Actions
uses: actions/upload-artifact@v4
with:
name: nupkg
path: ${{ env.PackageOutputPath }}/*.nupkg
path: ${{ env.ARTIFACTS_STAGING_DIR_PATH }}/*.nupkg

- name: Publish to GitHub Packages
if: github.ref == 'refs/heads/main'
shell: bash
run: dotnet nuget push ${{ env.PackageOutputPath }}/*.nupkg
run: dotnet nuget push ${{ env.ARTIFACTS_STAGING_DIR_PATH }}/*.nupkg

- name: Publish to nuget.org
if: github.ref == 'refs/heads/main'
shell: bash
run: >-
dotnet nuget push ${{ env.PackageOutputPath }}/*.nupkg --source
nuget.org -k ${{ secrets.NUGET_TOKEN }}
run: dotnet nuget push ${{ env.ARTIFACTS_STAGING_DIR_PATH }}/*.nupkg -s nuget.org -k ${{ secrets.NUGET_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/generate-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: dotnet restore
- name: Generate
run: >-
dotnet run --project ./Tools/Generate/Generate.csproj -- ${{
github.token }} ./Octokit.GraphQL/
dotnet run --project ./tools/Generate/Generate.csproj -- ${{
github.token }} ./src/Octokit.GraphQL/
- name: Build
run: dotnet build
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
dotnet test -c ${{ env.config }} --no-build /p:CollectCoverage=true
/p:CoverletOutputFormat=opencover
/p:Exclude="[Octokit.GraphQL]Octokit.GraphQL.*"
.\Octokit.GraphQL.IntegrationTests\Octokit.GraphQL.IntegrationTests.csproj
.\src\Octokit.GraphQL.IntegrationTests\Octokit.GraphQL.IntegrationTests.csproj
env:
OCTOKIT_GQL_OAUTHTOKEN: ${{ secrets.OCTOKIT_GQL_OAUTHTOKEN }}
OCTOKIT_GQL_GITHUBUSERNAME: ${{ secrets.OCTOKIT_GQL_GITHUBUSERNAME }}
Loading

0 comments on commit 7607fa1

Please sign in to comment.