From 509e33a570c3eacd809d486ab4cc813c5914d74c Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Fri, 20 Sep 2024 04:59:26 +0900 Subject: [PATCH 1/6] Delete workflows --- .github/workflows/add_to_octokit_project.yml | 20 ------------ ...mediate-response.yml => auto-response.yml} | 26 ++++++++++++---- .github/workflows/{dotnetcore.yml => ci.yml} | 2 +- .github/workflows/generate-schema.yml | 28 ----------------- .github/workflows/integration-tests.yml | 31 ------------------- 5 files changed, 21 insertions(+), 86 deletions(-) delete mode 100644 .github/workflows/add_to_octokit_project.yml rename .github/workflows/{immediate-response.yml => auto-response.yml} (65%) rename .github/workflows/{dotnetcore.yml => ci.yml} (98%) delete mode 100644 .github/workflows/generate-schema.yml delete mode 100644 .github/workflows/integration-tests.yml diff --git a/.github/workflows/add_to_octokit_project.yml b/.github/workflows/add_to_octokit_project.yml deleted file mode 100644 index 936e1f4f..00000000 --- a/.github/workflows/add_to_octokit_project.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Add PRs and issues to Octokit org project - -on: - issues: - types: [reopened, opened] - pull_request_target: - types: [reopened, opened] - -jobs: - add-to-project: - name: Add issue to project - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/add-to-project@v1.0.1 - with: - project-url: https://github.com/orgs/octokit/projects/10 - github-token: ${{ secrets.OCTOKITBOT_PROJECT_ACTION_TOKEN }} - labeled: "Status: Stale" - label-operator: NOT diff --git a/.github/workflows/immediate-response.yml b/.github/workflows/auto-response.yml similarity index 65% rename from .github/workflows/immediate-response.yml rename to .github/workflows/auto-response.yml index 8a29b200..cd9a81c8 100644 --- a/.github/workflows/immediate-response.yml +++ b/.github/workflows/auto-response.yml @@ -1,18 +1,21 @@ name: Issue/PR response + permissions: issues: write pull-requests: write + on: issues: - types: - - opened + types: [reopened, opened] pull_request_target: - types: - - opened + types: [reopened, opened] + jobs: + respond-to-issue: - if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && github.actor != 'githubactions[bot]' && github.actor != 'octokitbot' }} + if: ${{ github.event.action == 'opened' && github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && github.actor != 'githubactions[bot]' && github.actor != 'octokitbot' }} runs-on: ubuntu-latest + steps: - name: Determine issue or PR number id: extract @@ -22,8 +25,19 @@ jobs: uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{ steps.extract.outputs.NUMBER }} - body: > + body: | 👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a [process in place](https://github.com/octokit/.github/blob/main/community/prioritization_response.md#overview) for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with `Status: Up for grabs`. You & others like you are the reason all of this works! So thank you & happy coding! 🚀 + + add-to-project: + runs-on: ubuntu-latest + + steps: + - uses: actions/add-to-project@v0.5.0 + with: + project-url: https://github.com/orgs/octokit/projects/10 + github-token: ${{ secrets.OCTOKITBOT_PROJECT_ACTION_TOKEN }} + labeled: "Status: Stale" + label-operator: NOT diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/ci.yml similarity index 98% rename from .github/workflows/dotnetcore.yml rename to .github/workflows/ci.yml index 7d5fd9c0..370c9575 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Build, test and publish +name: Octokit.GraphQL CI on: push: diff --git a/.github/workflows/generate-schema.yml b/.github/workflows/generate-schema.yml deleted file mode 100644 index 2918f7d8..00000000 --- a/.github/workflows/generate-schema.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Test Generate Schema -"on": - push: - branches: - - main - pull_request: - branches: - - main - schedule: - - cron: 0 0 * * * - workflow_dispatch: -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.x - - name: Install dependencies - run: dotnet restore - - name: Generate - run: >- - dotnet run --project ./tools/Generate/Generate.csproj -- ${{ - github.token }} ./src/Octokit.GraphQL/ - - name: Build - run: dotnet build diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml deleted file mode 100644 index d7bdd711..00000000 --- a/.github/workflows/integration-tests.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Integration tests -"on": - push: null - schedule: - - cron: 0 */24 * * * - workflow_dispatch: - watch: - types: - - started -env: - config: Release -jobs: - integration-tests: - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.101 - - name: Build using .NET Core - run: dotnet build Octokit.GraphQL.sln -c ${{ env.config }} - - name: Run integration tests - run: >- - dotnet test -c ${{ env.config }} --no-build /p:CollectCoverage=true - /p:CoverletOutputFormat=opencover - /p:Exclude="[Octokit.GraphQL]Octokit.GraphQL.*" - .\src\Octokit.GraphQL.IntegrationTests\Octokit.GraphQL.IntegrationTests.csproj - env: - OCTOKIT_GQL_OAUTHTOKEN: ${{ secrets.OCTOKIT_GQL_OAUTHTOKEN }} - OCTOKIT_GQL_GITHUBUSERNAME: ${{ secrets.OCTOKIT_GQL_GITHUBUSERNAME }} From 5e91bb7791d459afd4f9256888983b09a1eb3ba6 Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Fri, 20 Sep 2024 05:42:41 +0900 Subject: [PATCH 2/6] Update Issue/PR response workflow --- .github/workflows/auto-response.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/auto-response.yml b/.github/workflows/auto-response.yml index cd9a81c8..ca999a39 100644 --- a/.github/workflows/auto-response.yml +++ b/.github/workflows/auto-response.yml @@ -1,3 +1,6 @@ +# This comes from https://github.com/octokit/.github/tree/main/.github/templates +# Please edit the workflow in there too when you make changes to this workflow. + name: Issue/PR response permissions: @@ -6,14 +9,14 @@ permissions: on: issues: - types: [reopened, opened] + types: [opened] pull_request_target: - types: [reopened, opened] + types: [opened] jobs: - respond-to-issue: - if: ${{ github.event.action == 'opened' && github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && github.actor != 'githubactions[bot]' && github.actor != 'octokitbot' }} + respond: + if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && github.actor != 'githubactions[bot]' && github.actor != 'octokitbot' }} runs-on: ubuntu-latest steps: @@ -21,7 +24,7 @@ jobs: id: extract run: echo "NUMBER=${{ github.event.issue.number || github.event.pull_request.number }}" >> "$GITHUB_OUTPUT" - - name: Respond to issue or PR + - name: Respond to the issue or PR uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{ steps.extract.outputs.NUMBER }} @@ -31,11 +34,8 @@ jobs: Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with `Status: Up for grabs`. You & others like you are the reason all of this works! So thank you & happy coding! 🚀 - add-to-project: - runs-on: ubuntu-latest - - steps: - - uses: actions/add-to-project@v0.5.0 + - name: Add issue to project + uses: actions/add-to-project@v1 with: project-url: https://github.com/orgs/octokit/projects/10 github-token: ${{ secrets.OCTOKITBOT_PROJECT_ACTION_TOKEN }} From b138d4e6b11d54402f8258bc3e5cb354b530c13b Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Fri, 20 Sep 2024 05:23:59 +0900 Subject: [PATCH 3/6] Update the CI --- .github/workflows/ci.yml | 74 +++++++++++++++++++++++++++++----------- Octokit.GraphQL.sln | 4 +-- 2 files changed, 56 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 370c9575..a9bad0a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,56 +14,90 @@ on: workflow_dispatch: env: - 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" + CONFIGURATION: 'Release' + ARTIFACTS_STAGING_DIR_PATH: '${{ github.workspace }}/nupkg' + OG_SOLUTION_PATH: '${{ github.workspace }}/Octokit.GraphQL.sln' + OG_UNIT_TESTS_PROJ_PATH: '${{ github.workspace }}/src/Octokit.GraphQL.UnitTests/Octokit.GraphQL.UnitTests.csproj' + OG_CORE_UNIT_TESTS_PROJ_PATH: '${{ github.workspace }}/src/Octokit.GraphQL.Core.UnitTests/Octokit.GraphQL.Core.UnitTests.csproj' + OG_CORE_GENERATOR_UNIT_TESTS_PROJ_PATH: '${{ github.workspace }}/src/Octokit.GraphQL.Core.Generation.UnitTests/Octokit.GraphQL.Core.Generation.UnitTests.csproj' + OG_INTEGRATION_TESTS_PROJ_PATH: '${{ github.workspace }}/src/Octokit.GraphQL.IntegrationTests/Octokit.GraphQL.IntegrationTests.csproj' + OG_PACK_PROJ_PATH: '${{ github.workspace }}/src/Octokit.GraphQL.Pack/Octokit.GraphQL.Pack.csproj' jobs: - build-test-publish: - runs-on: windows-latest + build: + runs-on: ubuntu-latest steps: - name: Checkout the repository uses: actions/checkout@v4 - - name: Setup .NET & GitHub Packages + - name: Setup .NET 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 }} - name: Setup NuGet uses: nuget/setup-nuget@v2 - name: Build the solution run: dotnet build ${{ env.OG_SOLUTION_PATH }} -c ${{ env.CONFIGURATION }} + test: + runs-on: ubuntu-latest + steps: + + - name: Checkout the repository + uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 3.1.101 + - name: Setup NuGet + uses: nuget/setup-nuget@v2 + - name: Run Octokit.GraphQL.UnitTests - run: dotnet test -c ${{ env.CONFIGURATION }} --no-build ${{ env.OG_UNIT_TESTS_PROJ_PATH }} + 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.CONFIGURATION }} --no-build ${{ env.OG_CORE_UNIT_TESTS_PROJ_PATH }} + 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.CONFIGURATION }} --no-build ${{ env.OG_CORE_GENERATOR_UNIT_TESTS_PROJ_PATH }} + run: 'dotnet test -c ${{ env.CONFIGURATION }} --no-build "${{ env.OG_CORE_GENERATOR_UNIT_TESTS_PROJ_PATH }}"' + + - name: Run Octokit.GraphQL.IntegrationTests + run: 'dotnet test -c ${{ env.CONFIGURATION }} --no-build -p:CollectCoverage=true -p:CoverletOutputFormat=opencover -p:Exclude="[Octokit.GraphQL]Octokit.GraphQL.*" "${{ env.OG_INTEGRATION_TESTS_PROJ_PATH }}"' + env: + OCTOKIT_GQL_OAUTHTOKEN: ${{ secrets.OCTOKIT_GQL_OAUTHTOKEN }} + OCTOKIT_GQL_GITHUBUSERNAME: ${{ secrets.OCTOKIT_GQL_GITHUBUSERNAME }} + + pack: + runs-on: ubuntu-latest + steps: + + - 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 }} + + - name: Build the solution + run: 'dotnet build ${{ env.OG_SOLUTION_PATH }} -c "${{ env.CONFIGURATION }}"' - name: Create the new package - run: dotnet pack ${{ env.OG_PACK_PROJ_PATH }} -o ${{ env.ARTIFACTS_STAGING_DIR_PATH }} + 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.ARTIFACTS_STAGING_DIR_PATH }}/*.nupkg + path: '${{ env.ARTIFACTS_STAGING_DIR_PATH }}/*.nupkg' - name: Publish to GitHub Packages if: github.ref == 'refs/heads/main' - run: dotnet nuget push ${{ env.ARTIFACTS_STAGING_DIR_PATH }}/*.nupkg + run: 'dotnet nuget push "${{ env.ARTIFACTS_STAGING_DIR_PATH }}/*.nupkg"' - name: Publish to nuget.org if: github.ref == 'refs/heads/main' - run: dotnet nuget push ${{ env.ARTIFACTS_STAGING_DIR_PATH }}/*.nupkg -s nuget.org -k ${{ secrets.NUGET_TOKEN }} + run: 'dotnet nuget push "${{ env.ARTIFACTS_STAGING_DIR_PATH }}/*.nupkg" -s nuget.org -k ${{ secrets.NUGET_TOKEN }}' diff --git a/Octokit.GraphQL.sln b/Octokit.GraphQL.sln index 9c143187..7e957599 100644 --- a/Octokit.GraphQL.sln +++ b/Octokit.GraphQL.sln @@ -3,13 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.12.35209.166 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generate", "Tools\Generate\Generate.csproj", "{ECCD7CFD-C72B-4D49-81D3-76B666D81DD3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generate", "tools\Generate\Generate.csproj", "{ECCD7CFD-C72B-4D49-81D3-76B666D81DD3}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{516AB6AE-153D-4776-B861-DF653A0E54BF}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{369BC54B-D0C7-4F5B-BBAA-D84732192187}" ProjectSection(SolutionItems) = preProject - Scripts\configure-integration-tests.ps1 = Scripts\configure-integration-tests.ps1 + Scripts\configure-integration-tests.ps1 = scripts\configure-integration-tests.ps1 EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F50E915E-5C1C-4170-95B7-EA4E67D42423}" From 9ff5be65635e2b5ecb27cee0de22a9b0aa81b472 Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Sat, 28 Sep 2024 15:16:22 +0900 Subject: [PATCH 4/6] Update and rename auto-response.yml to immediate-response.yml Signed-off-by: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> --- ...to-response.yml => immediate-response.yml} | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) rename .github/workflows/{auto-response.yml => immediate-response.yml} (68%) diff --git a/.github/workflows/auto-response.yml b/.github/workflows/immediate-response.yml similarity index 68% rename from .github/workflows/auto-response.yml rename to .github/workflows/immediate-response.yml index ca999a39..8a29b200 100644 --- a/.github/workflows/auto-response.yml +++ b/.github/workflows/immediate-response.yml @@ -1,43 +1,29 @@ -# This comes from https://github.com/octokit/.github/tree/main/.github/templates -# Please edit the workflow in there too when you make changes to this workflow. - name: Issue/PR response - permissions: issues: write pull-requests: write - on: issues: - types: [opened] + types: + - opened pull_request_target: - types: [opened] - + types: + - opened jobs: - - respond: + respond-to-issue: if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && github.actor != 'githubactions[bot]' && github.actor != 'octokitbot' }} runs-on: ubuntu-latest - steps: - name: Determine issue or PR number id: extract run: echo "NUMBER=${{ github.event.issue.number || github.event.pull_request.number }}" >> "$GITHUB_OUTPUT" - - name: Respond to the issue or PR + - name: Respond to issue or PR uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{ steps.extract.outputs.NUMBER }} - body: | + body: > 👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a [process in place](https://github.com/octokit/.github/blob/main/community/prioritization_response.md#overview) for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with `Status: Up for grabs`. You & others like you are the reason all of this works! So thank you & happy coding! 🚀 - - - name: Add issue to project - uses: actions/add-to-project@v1 - with: - project-url: https://github.com/orgs/octokit/projects/10 - github-token: ${{ secrets.OCTOKITBOT_PROJECT_ACTION_TOKEN }} - labeled: "Status: Stale" - label-operator: NOT From c0aefcbe9c18cc77776e15ded3dcedcca87800f7 Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Sat, 28 Sep 2024 15:19:40 +0900 Subject: [PATCH 5/6] Create add_to_octokit_project.yml Signed-off-by: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> --- .github/workflows/add_to_octokit_project.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/add_to_octokit_project.yml diff --git a/.github/workflows/add_to_octokit_project.yml b/.github/workflows/add_to_octokit_project.yml new file mode 100644 index 00000000..936e1f4f --- /dev/null +++ b/.github/workflows/add_to_octokit_project.yml @@ -0,0 +1,20 @@ +name: Add PRs and issues to Octokit org project + +on: + issues: + types: [reopened, opened] + pull_request_target: + types: [reopened, opened] + +jobs: + add-to-project: + name: Add issue to project + runs-on: ubuntu-latest + continue-on-error: true + steps: + - uses: actions/add-to-project@v1.0.1 + with: + project-url: https://github.com/orgs/octokit/projects/10 + github-token: ${{ secrets.OCTOKITBOT_PROJECT_ACTION_TOKEN }} + labeled: "Status: Stale" + label-operator: NOT From 0029ddeab2c020bb4efdb49e783bbb3cab08fc38 Mon Sep 17 00:00:00 2001 From: Lamparter Date: Mon, 7 Oct 2024 22:56:23 +0100 Subject: [PATCH 6/6] Fix CI badge in `README.md` (#328) Signed-off-by: Lamparter --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 87aa821f..a933ec33 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,7 @@

- CI Status + CI Status CodeCov Status