|
1 | | -name: Generate and Publish SDK Sources |
2 | | - |
3 | 1 | on: |
4 | 2 | workflow_dispatch: |
5 | 3 | inputs: |
6 | 4 | version: |
7 | | - description: | |
8 | | - SDK Version. |
9 | | - E.g., 1.0.0, 1.0.1, 1.0.0-SNAPSHOT, etc. |
10 | | - required: true |
11 | 5 | type: string |
| 6 | + description: "Version to publish. For snapshot releases, add `-SNAPSHOT` suffix to the version. For example, `1.0.0-SNAPSHOT`." |
| 7 | + required: true |
12 | 8 |
|
13 | 9 | jobs: |
14 | | - generate-and-publish-sources: |
15 | | - uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-full-workflow.yaml@v20250304 |
16 | | - secrets: inherit |
17 | | - with: |
18 | | - name: xap |
19 | | - ref: ${{ github.head_ref || github.ref_name }} |
20 | | - repository: 'ExpediaGroup/xap-java-sdk' |
21 | | - sdk_repo_ref: 'v20250304' |
22 | | - transformations: '--headers key --operationIdsToTags' |
23 | | - version: ${{ inputs.version }} |
| 10 | + generate-and-publish: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + |
| 15 | + - uses: actions/setup-java@v3 |
| 16 | + with: |
| 17 | + distribution: 'corretto' |
| 18 | + java-version: '21' |
| 19 | + |
| 20 | + - uses: gradle/actions/setup-gradle@v4 |
| 21 | + with: |
| 22 | + gradle-version: "8.13" |
| 23 | + |
| 24 | + - name: Install Post Processor |
| 25 | + working-directory: generator/src/main/resources/post-processor |
| 26 | + run: npm ci && npm run clean && npm run compile |
| 27 | + |
| 28 | + - run: gradle build |
| 29 | + |
| 30 | + - name: Generate SDK |
| 31 | + working-directory: generator |
| 32 | + run: | |
| 33 | + export KOTLIN_POST_PROCESS_FILE="npm run --prefix src/main/resources/post-processor process" |
| 34 | + gradle openApiGenerate |
| 35 | +
|
| 36 | + - name: Open PR |
| 37 | + uses: peter-evans/create-pull-request@v7 |
| 38 | + working-directory: xap-sdk |
| 39 | + with: |
| 40 | + token: ${{ secrets.GITHUB_PAT }} |
| 41 | + commit-message: "chore: publishing code for sdk release $(date +'%Y%m%d%H%M%S')" |
| 42 | + title: "chore: code update on $(date +'%Y%m%d%H%M%S')" |
| 43 | + branch: "xap-sdk-code-update-$(date +'%Y%m%d%H%M%S')" |
| 44 | + add-paths: . |
0 commit comments