Skip to content

Commit 31839e1

Browse files
feat: github actions and dokka config (#132)
Co-authored-by: Mohammad Dwairi <49045447+Mohammad-Dwairi@users.noreply.github.com>
1 parent e6dc97d commit 31839e1

File tree

5 files changed

+89
-33
lines changed

5 files changed

+89
-33
lines changed
Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,44 @@
1-
name: Generate and Publish SDK Sources
2-
31
on:
42
workflow_dispatch:
53
inputs:
64
version:
7-
description: |
8-
SDK Version.
9-
E.g., 1.0.0, 1.0.1, 1.0.0-SNAPSHOT, etc.
10-
required: true
115
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
128

139
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: .

.github/workflows/generate-docs-site.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ permissions:
1414

1515
jobs:
1616
deploy-reference-docs:
17-
uses: "ExpediaGroup/expediagroup-java-sdk/.github/workflows/generate-ref-docs.yaml@main"
17+
uses: "ExpediaGroup/expediagroup-java-sdk/.github/workflows/generate-ref-docs.yaml@feature/new-sdk-core"
1818
with:
19-
buildsystem: 'maven'
2019
ref: ${{ inputs.ref != '' && inputs.ref || github.ref }}
20+
sources_dir: 'xap-sdk'
2121
secrets:
2222
GITHUB_PAT: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}

.github/workflows/release-sdk.yaml

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,27 @@ on:
1111
default: ''
1212

1313
jobs:
14-
integration-tests:
15-
strategy:
16-
matrix:
17-
jdk: [ 8, 11, 17, 21 ]
18-
uses: ./.github/workflows/integration-tests.yaml
19-
secrets: inherit
20-
with:
21-
branch: ${{ inputs.branch }}
22-
jdk: ${{ matrix.jdk }}
14+
release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
ref: ${{ github.ref_name }}
2322

24-
release-sdk:
25-
uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-release-sdk.yaml@v20250304
26-
needs: [ integration-tests ]
27-
secrets: inherit
28-
with:
29-
branch: ${{ inputs.branch }}
23+
- name: Publish SDK
24+
working-directory: xap-sdk
25+
env:
26+
GPG_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
27+
GPG_SECRET: ${{ secrets.GPG_PRIVATE_KEY }}
28+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
29+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
30+
run: |
31+
version="${{ github.event.inputs.version }}"
32+
version="${version// /}"
33+
if [[ "$version" == *"-SNAPSHOT" ]]; then
34+
gradle publishSnapshot -PVERSION="${version}"
35+
else
36+
gradle publishToSonatype closeAndReleaseSonatypeStagingRepository -PVERSION="${version}"
37+
fi

xap-sdk/build.gradle.kts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id("signing")
33
id("maven-publish")
4+
id("org.jetbrains.dokka") version "2.0.0"
45
id("com.github.hierynomus.license") version "0.16.1"
56
}
67

@@ -20,10 +21,35 @@ version = property("VERSION") as String
2021

2122
dependencies {
2223
api("com.expediagroup:expediagroup-sdk-rest:0.0.6-alpha")
24+
2325
implementation("com.fasterxml.jackson.core:jackson-databind:2.18.2")
2426
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.2")
2527
runtimeOnly("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2")
28+
2629
implementation("org.slf4j:slf4j-api:2.0.17")
30+
31+
dokkaHtmlPlugin("org.jetbrains.dokka:versioning-plugin:2.0.0")
32+
}
33+
34+
dokka {
35+
moduleName = "XAP SDK"
36+
37+
pluginsConfiguration {
38+
html {
39+
val dokkaAssets = File(project.findProperty("dokka-assets.location").toString())
40+
41+
customAssets.from(File(dokkaAssets, "logo-icon.svg"))
42+
customStyleSheets.from(File(dokkaAssets, "custom-styles.css"))
43+
}
44+
45+
versioning {
46+
version = project.property("VERSION") as String
47+
48+
olderVersionsDir.set(File(project.findProperty("dokka-old-versions.location").toString()))
49+
50+
renderVersionsNavigationOnAllPages = true
51+
}
52+
}
2753
}
2854

2955
apply("$rootDir/gradle-tasks/publish.gradle.kts")

xap-sdk/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ ARTIFACT_NAME=xap-sdk
22
DESCRIPTION=The Expedia API Platform (XAP) SDK
33

44
VERSION=2.0.0-SNAPSHOT
5+
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled

0 commit comments

Comments
 (0)