|
7 | 7 | type: string
|
8 | 8 | required: true
|
9 | 9 | description: 'The remote kubernetes release branch to fetch openapi spec. .e.g. "release-1.23"'
|
10 |
| - |
| 10 | + dry_run: |
| 11 | + type: boolean |
| 12 | + required: true |
| 13 | + default: false |
| 14 | + description: Dry run, will not send a PR |
| 15 | + skip_patches: |
| 16 | + type: boolean |
| 17 | + required: true |
| 18 | + default: false |
| 19 | + description: If true, skip patching code after generation |
11 | 20 |
|
12 | 21 | permissions:
|
13 | 22 | contents: read
|
| 23 | + pull-requests: write |
14 | 24 |
|
15 | 25 | jobs:
|
16 | 26 | generate:
|
@@ -59,37 +69,46 @@ jobs:
|
59 | 69 | export PACKAGE_NAME="io.kubernetes.client.openapi"
|
60 | 70 | EOF
|
61 | 71 |
|
62 |
| - USE_SINGLE_PARAMETER=false OPENAPI_GENERATOR_COMMIT=v4.3.1 bash java.sh ../../kubernetes/ settings |
| 72 | + USE_SINGLE_PARAMETER=true bash java.sh ../../kubernetes/ settings |
63 | 73 | popd
|
64 | 74 | rm -rf gen
|
| 75 | + git config user.email "[email protected]" |
| 76 | + git config user.name "Kubernetes Publisher" |
| 77 | + git checkout -b "$BRANCH" |
| 78 | + git add . |
| 79 | + git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}' |
| 80 | + - name: Apply Manual Diffs |
| 81 | + if: ${{ github.event.inputs.skip_patches != 'true' }} |
| 82 | + run: | |
| 83 | + ls scripts/patches/*.diff | xargs git apply |
| 84 | + git add . |
| 85 | + git commit -s -m 'Applied patches under scripts/patches/*.diff' |
65 | 86 | - name: Generate Fluent
|
66 | 87 | run: |
|
67 | 88 | # Only install the generated openapi module because the higher modules' compile
|
68 | 89 | # may fail due to api-changes.
|
69 |
| - mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Pfluent-gen -pl kubernetes -am clean install |
| 90 | + mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ |
| 91 | + -Dmaven.test.skip=true \ |
| 92 | + -Pfluent-gen \ |
| 93 | + -pl kubernetes -am clean install |
70 | 94 | pushd fluent-gen
|
71 | 95 | bash -x generate.sh
|
72 | 96 | popd
|
73 | 97 | - name: Formatter
|
74 | 98 | run: |
|
75 | 99 | mvn spotless:apply
|
76 | 100 | - name: Commit and push
|
| 101 | + if: ${{ github.event.inputs.dry_run != 'true' }} |
77 | 102 | run: |
|
78 | 103 | # Commit and push
|
79 |
| - git config user.email "[email protected]" |
80 |
| - git config user.name "Kubernetes Prow Robot" |
81 |
| - git checkout -b "$BRANCH" |
82 | 104 | git add .
|
83 |
| - git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}' |
| 105 | + git commit -s -m 'Format and fluent-gen from ${{ github.event.inputs.kubernetesBranch }}' |
84 | 106 | git push origin "$BRANCH"
|
85 | 107 | - name: Pull Request
|
| 108 | + if: ${{ github.event.inputs.dry_run != 'true' }} |
86 | 109 | uses: repo-sync/pull-request@v2
|
87 | 110 | with:
|
88 | 111 | source_branch: ${{ env.BRANCH }}
|
89 | 112 | destination_branch: ${{ github.ref_name }}
|
90 | 113 | github_token: ${{ secrets.GITHUB_TOKEN }}
|
91 | 114 | pr_title: "Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}"
|
92 |
| - |
93 |
| - |
94 |
| - |
95 |
| - |
|
0 commit comments