Skip to content

Commit 7a80ea2

Browse files
committed
feat: add java sdk generation job to pipeline
1 parent 5869628 commit 7a80ea2

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: Build
2+
description: "Build tools"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Install project tools and dependencies
7+
shell: bash
8+
run: make project-tools LANGUAGE=java
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Generate SDK
2+
description: "Generates the Java SDK"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Download OAS
7+
shell: bash
8+
run: make download-oas
9+
- name: Generate SDK
10+
shell: bash
11+
run: make generate-sdk LANGUAGE=java

.github/workflows/sdk-pr.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,33 @@ jobs:
7878
poetry config virtualenvs.create false
7979
(cd ./sdk-repo-updated && make install-dev)
8080
scripts/sdk-create-pr.sh "generator-bot-${{ github.run_id }}" "Generated from GitHub run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" "[email protected]:stackitcloud/stackit-sdk-python.git" "python"
81+
82+
main-java:
83+
name: "[Java] Update SDK Repo"
84+
runs-on: ubuntu-latest
85+
permissions:
86+
pull-requests: write
87+
contents: write
88+
steps:
89+
- name: Install SSH Key
90+
uses: shimataro/ssh-key-action@v2
91+
with:
92+
key: ${{ secrets.SSH_PRIVATE_KEY }}
93+
known_hosts: ${{ vars.SSH_KNOWN_HOSTS }}
94+
- name: Install Java
95+
uses: actions/setup-java@v4
96+
with:
97+
distribution: "temurin"
98+
java-version: ${{ env.JAVA_VERSION }}
99+
- name: Checkout
100+
uses: actions/checkout@v4
101+
- name: Build
102+
uses: ./.github/actions/build/java
103+
- name: Generate SDK
104+
uses: ./.github/actions/generate-sdk/java
105+
- name: Push SDK
106+
env:
107+
GH_REPO: "stackitcloud/stackit-sdk-java"
108+
GH_TOKEN: ${{ secrets.SDK_PR_TOKEN }}
109+
run: |
110+
scripts/sdk-create-pr.sh "generator-bot-${{ github.run_id }}" "Generated from GitHub run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" "[email protected]:stackitcloud/stackit-sdk-java.git" "java"

scripts/project.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ elif [ "$action" = "tools" ]; then
2626
go install golang.org/x/tools/cmd/goimports@latest
2727
elif [ "${LANGUAGE}" == "python" ]; then
2828
pip install black==24.8.0 isort~=5.13.2 autoimport~=1.6.1
29+
elif [ "${LANGUAGE}" == "java" ]; then
30+
# Java tools are typically installed via the system or actions/setup-java
31+
# Additional Java-specific tools can be added here if needed
32+
echo "Java tools are ready for use"
2933
else
3034
echo "! Invalid language: $($LANGUAGE), please use $0 help for help"
3135
fi

0 commit comments

Comments
 (0)