Skip to content

Commit 3d226b9

Browse files
cbettaaliminaei
andauthored
feat: New Speakeasy SDK (#66)
Co-authored-by: aliminaei <[email protected]>
1 parent 81c2b72 commit 3d226b9

File tree

1,353 files changed

+171164
-112235
lines changed

Some content is hidden

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

1,353 files changed

+171164
-112235
lines changed

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+
10+
# This allows generated code to be indexed correctly
11+
*.java linguist-generated=false

.github/workflows/ci.yaml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
workflow_dispatch: {}
10+
schedule:
11+
# “At 08:30 on every day-of-week from Monday through Friday.”
12+
- cron: 30 8 * * 1-5
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
18+
timeout-minutes: 3
19+
strategy:
20+
matrix:
21+
java:
22+
- 21
23+
24+
permissions:
25+
contents: write
26+
pull-requests: write
27+
28+
steps:
29+
- name: Check out the repo
30+
uses: actions/checkout@v2
31+
32+
- name: Use Java ${{ matrix.java }}
33+
uses: actions/setup-java@v4
34+
with:
35+
distribution: 'corretto'
36+
java-version: ${{ matrix.java }}
37+
38+
- name: Run tests
39+
env:
40+
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
41+
run: |
42+
./gradlew test
43+
44+
- uses: hmarr/auto-approve-action@v4
45+
if: "github.event.pull_request.user.login == 'github-actions[bot]'"
46+
with:
47+
github-token: ${{ secrets.DISPATCH_ACCESS_TOKEN }}
48+
49+
merge:
50+
needs: test
51+
runs-on: ubuntu-latest
52+
53+
permissions:
54+
contents: write
55+
pull-requests: write
56+
57+
steps:
58+
- id: automerge
59+
name: automerge
60+
if: "github.event.pull_request.user.login == 'github-actions[bot]'"
61+
uses: "pascalgn/[email protected]"
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.DISPATCH_ACCESS_TOKEN }}
64+
MERGE_LABELS: ''
65+
MERGE_REQUIRED_APPROVALS: 0
66+
MERGE_METHOD: squash
67+
MERGE_COMMIT_MESSAGE: "pull-request-title"
68+
MERGE_ERROR_FAIL: true
69+
MERGE_DELETE_BRANCH: true
70+
MERGE_FORKS: false
71+
UPDATE_METHOD: rebase
72+
73+
notify:
74+
needs: test
75+
runs-on: ubuntu-latest
76+
if: ${{ contains(needs.*.result, 'failure') }}
77+
steps:
78+
- name: Slack Notification
79+
uses: rtCamp/action-slack-notify@v2
80+
if: github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.user.login == 'github-actions[bot]')
81+
env:
82+
SLACK_USERNAME: Java SDK
83+
SLACK_TITLE: Java SDK
84+
SLACK_WEBHOOK: ${{ secrets.SLACK_SDK_WEBHOOK_URL }}
85+
SLACK_CHANNEL: sdk-updates
86+
SLACK_MSG_AUTHOR: gr4vy-code
87+
SLACK_ICON_EMOJI: ":gr4vy:"
88+
SLACK_COLOR: "failure"
89+
SLACK_MESSAGE_ON_FAILURE: "CI failed - `${{ github.event.commits[0].message }}`"
90+
SLACK_FOOTER: ""

.github/workflows/ci.yml

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

.github/workflows/sdk_generation.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Generate SDK
2+
permissions:
3+
checks: write
4+
contents: write
5+
pull-requests: write
6+
statuses: write
7+
id-token: write
8+
"on":
9+
repository_dispatch:
10+
types: openapi_published
11+
workflow_dispatch:
12+
inputs:
13+
force:
14+
description: Force generation of SDKs
15+
type: boolean
16+
default: false
17+
set_version:
18+
description: optionally set a specific SDK version
19+
type: string
20+
schedule:
21+
- cron: 0 0 * * *
22+
jobs:
23+
generate:
24+
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
25+
with:
26+
force: ${{ github.event.inputs.force }}
27+
mode: pr
28+
set_version: ${{ github.event.inputs.set_version }}
29+
secrets:
30+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
31+
java_gpg_passphrase: ${{ secrets.JAVA_GPG_PASSPHRASE }}
32+
java_gpg_secret_key: ${{ secrets.JAVA_GPG_SECRET_KEY }}
33+
ossrh_password: ${{ secrets.OSSRH_PASSWORD }}
34+
ossrh_username: ${{ secrets.OSSRH_USERNAME }}
35+
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
36+
37+
notify:
38+
needs: generate
39+
runs-on: ubuntu-latest
40+
if: ${{ contains(needs.*.result, 'failure') }}
41+
steps:
42+
- name: Slack Notification
43+
uses: rtCamp/action-slack-notify@v2
44+
if: github.ref == 'refs/heads/main'
45+
env:
46+
SLACK_USERNAME: Java SDK
47+
SLACK_TITLE: Java SDK
48+
SLACK_WEBHOOK: ${{ secrets.SLACK_SDK_WEBHOOK_URL }}
49+
SLACK_CHANNEL: sdk-updates
50+
SLACK_MSG_AUTHOR: gr4vy-code
51+
SLACK_ICON_EMOJI: ":gr4vy:"
52+
SLACK_COLOR: "failure"
53+
SLACK_MESSAGE_ON_FAILURE: "SDK generation failed"
54+
SLACK_FOOTER: ""

.github/workflows/sdk_publish.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Publish SDK
2+
permissions:
3+
checks: write
4+
contents: write
5+
pull-requests: write
6+
statuses: write
7+
id-token: write
8+
"on":
9+
push:
10+
branches:
11+
- main
12+
paths:
13+
- .speakeasy/gen.lock
14+
workflow_dispatch: {}
15+
jobs:
16+
publish:
17+
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15
18+
with:
19+
target: java
20+
secrets:
21+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
22+
java_gpg_passphrase: ${{ secrets.JAVA_GPG_PASSPHRASE }}
23+
java_gpg_secret_key: ${{ secrets.JAVA_GPG_SECRET_KEY }}
24+
ossrh_password: ${{ secrets.OSSRH_PASSWORD }}
25+
ossrh_username: ${{ secrets.OSSRH_USERNAME }}
26+
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
27+
28+
notify:
29+
needs: publish
30+
runs-on: ubuntu-latest
31+
if: always()
32+
steps:
33+
- name: Slack Notification
34+
uses: rtCamp/action-slack-notify@v2
35+
if: github.ref == 'refs/heads/main'
36+
env:
37+
SLACK_USERNAME: Java SDK
38+
SLACK_TITLE: Java SDK
39+
SLACK_WEBHOOK: ${{ secrets.SLACK_SDK_WEBHOOK_URL }}
40+
SLACK_CHANNEL: sdk-updates
41+
SLACK_MSG_AUTHOR: gr4vy-code
42+
SLACK_ICON_EMOJI: ":gr4vy:"
43+
SLACK_COLOR: "${{ contains(needs.*.result, 'failure') && 'failure' || 'success' }}"
44+
SLACK_MESSAGE_ON_SUCCESS: "SDK publishing succeeded - `${{ github.event.head_commit.message }}`"
45+
SLACK_MESSAGE_ON_FAILURE: "SDK publishing failed - `${{ github.event.head_commit.message }}`"
46+
SLACK_FOOTER: ""
47+
48+
dispatch:
49+
needs: publish
50+
strategy:
51+
matrix:
52+
repo:
53+
- gr4vy/gr4vy-docs-mintlify
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Notify SDKs
57+
uses: peter-evans/repository-dispatch@v3
58+
with:
59+
token: ${{ secrets.DISPATCH_ACCESS_TOKEN }}
60+
repository: ${{ matrix.repo }}
61+
event-type: sdk_updated

.github/workflows/sdk_tag.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Tag SDK samples
2+
permissions:
3+
checks: write
4+
contents: write
5+
pull-requests: write
6+
statuses: write
7+
"on":
8+
push:
9+
branches:
10+
- main
11+
workflow_dispatch: {}
12+
jobs:
13+
tag:
14+
uses: speakeasy-api/sdk-generation-action/.github/workflows/tag.yaml@v15
15+
with:
16+
registry_tags: main
17+
secrets:
18+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
19+
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}

.gitignore

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,13 @@
1-
*.class
2-
3-
# Mobile Tools for Java (J2ME)
4-
.mtj.tmp/
5-
6-
# Package Files #
7-
*.jar
8-
*.war
9-
*.ear
10-
11-
# exclude jar for gradle wrapper
12-
!gradle/wrapper/*.jar
13-
14-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
15-
hs_err_pid*
16-
17-
# build files
18-
**/target
19-
target
1+
# Ignore Gradle project-specific cache directory
202
.gradle
3+
# Ignore Gradle build output directory
214
build
5+
bin/
6+
# Ignore IDE-specific configs
7+
.project
228
.settings/
9+
.DS_Store
10+
**/.speakeasy/temp/
11+
**/.speakeasy/logs/
12+
.speakeasy/reports
2313
*.pem
24-
.classpath
25-
.travis.yml
26-
build.*
27-
gradle*
28-
settings.gradle
29-
git_push.sh
30-
31-
#ide files
32-
*.idea

.mvn/wrapper/maven-wrapper.properties

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

.openapi-generator-config.json

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

.openapi-generator-ignore

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

0 commit comments

Comments
 (0)