-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into OmarAlJarrah/enable-service-virtualization-f…
…or-contract-tests
- Loading branch information
Showing
12 changed files
with
259 additions
and
50 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
name: Generate and Publish SDK (Full Workflow) | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
name: | ||
description: 'SDK Name' | ||
required: true | ||
type: string | ||
version: | ||
description: | | ||
SDK Version. | ||
E.g., 1.0.0, 1.0.1, 1.0.0-SNAPSHOT, etc. | ||
required: true | ||
type: string | ||
templates: | ||
description: | | ||
Path to the templates directory. | ||
Use the default path if you are using the default templates. | ||
Use `sdk-repo` to refer to the `expediagroup-sdk` repo root path if needed. | ||
type: string | ||
default: 'sdk-repo/generator/openapi/src/main/resources/templates/expediagroup-sdk' | ||
repository: | ||
description: | | ||
Repository to generate the SDK in. | ||
Leave empty to use the current repository. | ||
type: string | ||
default: '' | ||
ref: | ||
description: | | ||
Branch or tag to checkout. | ||
Leave empty to use the default branch. | ||
type: string | ||
default: '' | ||
specs_key: | ||
description: | | ||
Key to the OpenAPI specs artifact and name | ||
(without extension, e.g. specs, the file is expected to have the extension .yaml). | ||
The artifact is expected to be in the root of the repository, unless you specify a different path | ||
using the specs_path input. | ||
type: string | ||
default: 'specs' | ||
specs_path: | ||
description: 'Path to the specs file in the provided repository' | ||
type: string | ||
default: 'specs.yaml' | ||
transformed_specs_key: | ||
description: | | ||
Key to the transformed specs artifact and name. | ||
(without extension, e.g. transformedSpecs, the file is expected to have the extension .yaml). | ||
This artifact will be generated by the transformation job and used to generate the SDK. | ||
This artifact will be published with this name into the provided sources_path directory. | ||
type: string | ||
default: 'transformedSpecs' | ||
transformations: | ||
description: 'Spec Transformer CLI Configurations' | ||
type: string | ||
default: '--headers --operationIdsToTags' | ||
sources_path: | ||
description: 'Path to publish the source code to. This should be a path of a directory where the source code will be published to' | ||
type: string | ||
default: 'code' | ||
sdk_key: | ||
description: | | ||
Key to the generated SDK artifact. | ||
This artifact will be generated by the generation job and used to publish the SDK. | ||
type: string | ||
default: 'sdk' | ||
|
||
|
||
jobs: | ||
show-inputs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Show inputs | ||
run: | | ||
echo "SDK Name: ${{ inputs.name }}" | ||
echo "SDK Version: ${{ inputs.version }}" | ||
echo "Templates: ${{ inputs.templates }}" | ||
echo "Repository: ${{ inputs.repository }}" | ||
echo "Ref: ${{ inputs.ref }}" | ||
echo "Specs Key: ${{ inputs.specs_key }}" | ||
echo "Specs Path: ${{ inputs.specs_path }}" | ||
echo "Transformed Specs Key: ${{ inputs.transformed_specs_key }}" | ||
echo "Transformations: ${{ inputs.transformations }}" | ||
echo "Sources Path: ${{ inputs.sources_path }}" | ||
echo "SDK Key: ${{ inputs.sdk_key }}" | ||
upload-specs: | ||
uses: ./.github/workflows/selfserve-upload-specs.yaml | ||
with: | ||
specs_key: ${{ inputs.specs_key }} | ||
specs_path: ${{ inputs.specs_path }} | ||
repository: ${{ inputs.repository }} | ||
ref: ${{ inputs.ref }} | ||
|
||
transform-specs: | ||
uses: ./.github/workflows/selfserve-transform-specs.yaml | ||
needs: [ upload-specs ] | ||
with: | ||
specs_key: ${{ inputs.specs_key }} | ||
transformations: ${{ inputs.transformations }} | ||
transformed_specs_key: ${{ inputs.transformed_specs_key }} | ||
|
||
generate-sdk: | ||
uses: ./.github/workflows/selfserve-generate.yaml | ||
needs: [ transform-specs ] | ||
with: | ||
name: ${{ inputs.name }} | ||
version: ${{ inputs.version }} | ||
templates: ${{ inputs.templates }} | ||
specs_key: ${{ inputs.transformed_specs_key }} | ||
sdk_key: ${{ inputs.sdk_key }} | ||
|
||
publish-sources: | ||
uses: ./.github/workflows/selfserve-publish-sources.yaml | ||
needs: [ generate-sdk ] | ||
with: | ||
version: ${{ inputs.version }} | ||
path: ${{ inputs.sources_path }} | ||
sdk_key: ${{ inputs.sdk_key }} | ||
specs_key: ${{ inputs.transformed_specs_key }} | ||
|
||
release: | ||
uses: ./.github/workflows/selfserve-release.yaml | ||
needs: [ generate-sdk, publish-sources ] | ||
with: | ||
sdk_key: ${{ inputs.sdk_key }} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Release an SDK to Maven Central | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
sdk_key: | ||
description: 'Key to the generated SDK artifact' | ||
default: 'sdk' | ||
type: string | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'temurin' | ||
server-id: oss-sonatype | ||
server-username: SONATYPE_USERNAME | ||
server-password: SONATYPE_PASSWORD | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
gpg-passphrase: GPG_PASSPHRASE | ||
settings-path: ${{ github.workspace }} | ||
|
||
- name: Download SDK Artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.sdk_key }} | ||
path: sdk | ||
|
||
- name: Release SDK | ||
working-directory: sdk | ||
env: | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} | ||
run: | | ||
echo "Starting SDK Release - version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" | ||
mvn deploy --settings $GITHUB_WORKSPACE/settings.xml -B -U -P release -DskipTests=true | ||
echo "SDK Released" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Upload Specs (from Repo) | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
repository: | ||
description: | | ||
Repository to download the specs from. | ||
Leave empty to use the current repository. | ||
type: string | ||
default: '' | ||
ref: | ||
description: | | ||
Branch or tag to checkout. | ||
Leave empty to use the default branch. | ||
type: string | ||
default: '' | ||
specs_key: | ||
description: 'Key to the specs artifact' | ||
type: string | ||
default: 'specs' | ||
specs_path: | ||
description: 'Path to the specs file' | ||
type: string | ||
default: 'specs.yaml' | ||
|
||
jobs: | ||
upload-specs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ inputs.repository }} | ||
ref: ${{ inputs.ref }} | ||
|
||
- name: Upload specs | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.specs_key }} | ||
path: ${{ inputs.specs_path }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip | ||
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar |
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
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
Oops, something went wrong.