Skip to content

Commit 81d1626

Browse files
feat: sync and cleanup (#149)
1 parent 31839e1 commit 81d1626

File tree

481 files changed

+49346
-14503
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

481 files changed

+49346
-14503
lines changed

.github/workflows/generate-and-publish-sdk-sources.yaml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/integration-tests.yaml

Lines changed: 0 additions & 65 deletions
This file was deleted.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Snapshot Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
run-e2e-examples:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout Repo
11+
uses: actions/checkout@v4
12+
13+
- name: Run Examples
14+
uses: ./.github/workflows/run-examples.yaml
15+
with:
16+
branch: 'v2-dev' # TODO: Update to main
17+
jdk: '8'
18+
19+
run-integration-tests:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout Repo
23+
uses: actions/checkout@v4
24+
25+
- name: Run Examples
26+
uses: ./.github/workflows/run-integration-tests.yaml
27+
with:
28+
branch: 'v2-dev' # TODO: Update to main
29+
jdk: '8'
30+
31+
release:
32+
runs-on: ubuntu-latest
33+
needs: [run-e2e-examples, run-integration-tests]
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
ref: v2-dev # TODO: Update to main
40+
41+
- name: Publish SDK
42+
env:
43+
GPG_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
44+
GPG_SECRET: ${{ secrets.GPG_PRIVATE_KEY }}
45+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
46+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
47+
run: |
48+
./gradlew :xap-sdk:publishSnapshots
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Stable Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
run-e2e-examples:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout Repo
11+
uses: actions/checkout@v4
12+
13+
- name: Run Examples
14+
uses: ./.github/workflows/run-examples.yaml
15+
with:
16+
branch: 'v2-dev' # TODO: Update to main
17+
jdk: '8'
18+
19+
run-integration-tests:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout Repo
23+
uses: actions/checkout@v4
24+
25+
- name: Run Examples
26+
uses: ./.github/workflows/run-integration-tests.yaml
27+
with:
28+
branch: 'v2-dev' # TODO: Update to main
29+
jdk: '8'
30+
31+
release:
32+
runs-on: ubuntu-latest
33+
needs: [run-e2e-examples, run-integration-tests]
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
ref: v2-dev # TODO: Update to main
40+
41+
- name: Publish SDK
42+
env:
43+
GPG_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
44+
GPG_SECRET: ${{ secrets.GPG_PRIVATE_KEY }}
45+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
46+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
47+
run: |
48+
./gradlew :xap-sdk:publishToSonatype closeAndReleaseSonatypeStagingRepository

.github/workflows/release-sdk.yaml

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: Run Examples
2+
23
on:
3-
workflow_call:
4-
inputs:
4+
workflow_dispatch:
5+
inputs: &shared_inputs
56
jdk:
67
description: 'JDK version to use'
78
required: true
@@ -16,50 +17,29 @@ on:
1617
required: true
1718
type: string
1819

20+
workflow_call:
21+
inputs: *shared_inputs
22+
1923
jobs:
2024
run-examples:
2125
runs-on: ubuntu-latest
2226
steps:
23-
- name: Checkout repo
27+
- name: Checkout Repo
2428
uses: actions/checkout@v4
2529
with:
26-
repository: 'ExpediaGroup/xap-java-sdk'
2730
ref: ${{ inputs.branch }}
28-
path: sdk-repo
29-
30-
- name: Parse SDK version
31-
id: parse-sdk-version
32-
working-directory: sdk-repo/code
33-
shell: python -u {0}
34-
run: |
35-
import os
36-
import xml.etree.ElementTree as ET
37-
38-
tree = ET.parse("pom.xml")
39-
root = tree.getroot()
40-
version = root.find("{*}version").text
41-
42-
with open(os.getenv("GITHUB_OUTPUT"), "a") as GITHUB_OUTPUT:
43-
print(f"version={version}", file=GITHUB_OUTPUT)
4431

45-
- name: Set up JDK
32+
- name: Setup JDK
4633
uses: actions/setup-java@v4
4734
with:
4835
java-version: ${{ inputs.jdk }}
4936
distribution: ${{ inputs.distribution }}
5037

51-
- name: Install SDK
52-
working-directory: sdk-repo/code
53-
run: |
54-
mvn clean install
55-
5638
- name: Run Examples
57-
working-directory: sdk-repo/examples
39+
env:
40+
XAP_KEY: "${{ secrets.API_KEY }}"
41+
XAP_SECRET: "${{ secrets.API_SECRET }}"
42+
VRBO_KEY: "${{ secrets.VRBO_KEY }}"
43+
VRBO_SECRET: "${{ secrets.VRBO_SECRET }}"
5844
run: |
59-
mvn install exec:java \
60-
-Dexec.mainClass="com.expediagroup.sdk.xap.examples.XapSdkDemoTestRun" \
61-
-Dcom.expediagroup.xapjavasdk.apikey="${{ secrets.API_KEY }}" \
62-
-Dcom.expediagroup.xapjavasdk.apisecret="${{ secrets.API_SECRET }}" \
63-
-Dcom.expediagroup.xapjavasdk.vrbokey="${{ secrets.VRBO_KEY }}" \
64-
-Dcom.expediagroup.xapjavasdk.vrbosecret="${{ secrets.VRBO_SECRET }}" \
65-
-Dxap-java-sdk.sdk.version="${{ steps.parse-sdk-version.outputs.version }}"
45+
./gradlew :examples:run
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Integration Tests
2+
3+
on:
4+
workflow_dispatch:
5+
inputs: &shared_inputs
6+
jdk:
7+
description: 'JDK version to use'
8+
required: true
9+
type: string
10+
distribution:
11+
description: 'JDK distribution to use'
12+
required: false
13+
type: string
14+
default: 'corretto'
15+
branch:
16+
description: 'Branch to build SDK and run examples from'
17+
required: true
18+
type: string
19+
20+
workflow_call:
21+
inputs: *shared_inputs
22+
23+
jobs:
24+
integration-tests:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout Repo
28+
uses: actions/checkout@v4
29+
with:
30+
ref: ${{ inputs.branch }}
31+
32+
- name: Set up JDK
33+
uses: actions/setup-java@v4
34+
with:
35+
java-version: ${{ inputs.jdk }}
36+
distribution: ${{ inputs.distribution }}
37+
38+
- name: Run Integration Tests
39+
run: |
40+
./gradlew :integration-tests:test

0 commit comments

Comments
 (0)