Generate GHEC #63
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Generate .NET SDK" | |
on: | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
# Run generation nightly on latest OpenAPI spec | |
- cron: '0 0 * * *' | |
jobs: | |
cloud-builds: | |
strategy: | |
matrix: | |
platform: [dotcom, ghec] | |
fail-fast: false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.x.x' | |
- uses: actions/setup-go@v3.5.0 | |
with: | |
go-version: '1.21.5' | |
- name: Run scripts/generate-dotnet.sh | |
run: scripts/generate-dotnet.sh ${{ matrix.platform }} | |
- name: Clone the existing dotnet-sdk | |
run: | | |
cd ../ | |
git clone https://github.com/octokit/dotnet-sdk.git | |
# TODO(kfcampbell): translation step to turn platform name --> repo name | |
# also need to create repo | |
- name: Copy generated code to dotnet-sdk | |
run: cp -rf stage/dotnet/dotnet-sdk/* ../dotnet-sdk/ | |
- uses: gr2m/create-or-update-pull-request-action@cd-path | |
if: github.event_name != 'pull_request' # do not update the SDK on PR builds | |
env: | |
GITHUB_TOKEN: ${{ secrets.OCTOKITBOT_PAT }} | |
with: | |
title: "Changes in generated code" | |
body: > | |
The latest OpenAPI spec resulted in changes to the generated code. Please review, set an applicable | |
commit message, merge, and tag a release as appropriate. | |
branch: "generated-code-update" | |
author: "Octokit Bot <octokitbot@martynus.net>" | |
commit-message: "New updates to generated code" | |
repository: "octokit/dotnet-sdk" | |
path-to-cd-to: "../dotnet-sdk" |