Skip to content

Commit fd99ff1

Browse files
authored
Merge pull request #2 from run-llama/stainless/release
Release SDK updates
2 parents 604f2aa + bf2e5ae commit fd99ff1

140 files changed

Lines changed: 8807 additions & 651 deletions

File tree

Some content is hidden

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

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
lint:
1919
timeout-minutes: 15
2020
name: lint
21-
runs-on: ${{ github.repository == 'stainless-sdks/llamacloud-prod-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
21+
runs-on: ubuntu-latest
2222
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
2323

2424
steps:
@@ -45,7 +45,7 @@ jobs:
4545
permissions:
4646
contents: read
4747
id-token: write
48-
runs-on: ${{ github.repository == 'stainless-sdks/llamacloud-prod-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
48+
runs-on: ubuntu-latest
4949
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
5050

5151
steps:
@@ -66,44 +66,6 @@ jobs:
6666
- name: Build SDK
6767
run: ./scripts/build
6868

69-
- name: Get GitHub OIDC Token
70-
if: |-
71-
github.repository == 'stainless-sdks/llamacloud-prod-java' &&
72-
!startsWith(github.ref, 'refs/heads/stl/')
73-
id: github-oidc
74-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
75-
with:
76-
script: core.setOutput('github_token', await core.getIDToken());
7769

78-
- name: Build and upload Maven artifacts
79-
if: |-
80-
github.repository == 'stainless-sdks/llamacloud-prod-java' &&
81-
!startsWith(github.ref, 'refs/heads/stl/')
82-
env:
83-
URL: https://pkg.stainless.com/s
84-
AUTH: ${{ steps.github-oidc.outputs.github_token }}
85-
SHA: ${{ github.sha }}
86-
PROJECT: llamacloud-prod-java
87-
run: ./scripts/upload-artifacts
88-
test:
89-
timeout-minutes: 15
90-
name: test
91-
runs-on: ${{ github.repository == 'stainless-sdks/llamacloud-prod-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
92-
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
93-
steps:
94-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
95-
96-
- name: Set up Java
97-
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
98-
with:
99-
distribution: temurin
100-
java-version: |
101-
8
102-
21
103-
cache: gradle
10470

105-
- name: Set up Gradle
106-
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0
10771

108-
- name: Run tests
109-
run: ./scripts/test
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow is triggered when a GitHub release is created.
2+
# It can also be run manually to re-publish to Sonatype in case it failed for some reason.
3+
# You can run this workflow by navigating to https://www.github.com/run-llama/llama-parse-java/actions/workflows/publish-sonatype.yml
4+
name: Publish Sonatype
5+
on:
6+
workflow_dispatch:
7+
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
publish:
13+
name: publish
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
19+
- name: Set up Java
20+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
21+
with:
22+
distribution: temurin
23+
java-version: |
24+
8
25+
21
26+
cache: gradle
27+
28+
- name: Set up Gradle
29+
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0
30+
31+
- name: Publish to Sonatype
32+
run: |-
33+
export -- GPG_SIGNING_KEY_ID
34+
printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD"
35+
GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')"
36+
./gradlew publish --no-configuration-cache
37+
env:
38+
SONATYPE_USERNAME: ${{ secrets.LLAMA_CLOUD_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
39+
SONATYPE_PASSWORD: ${{ secrets.LLAMA_CLOUD_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
40+
GPG_SIGNING_KEY: ${{ secrets.LLAMA_CLOUD_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }}
41+
GPG_SIGNING_PASSWORD: ${{ secrets.LLAMA_CLOUD_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release Doctor
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
jobs:
9+
release_doctor:
10+
name: release doctor
11+
runs-on: ubuntu-latest
12+
if: github.repository == 'run-llama/llama-parse-java' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
13+
14+
steps:
15+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
17+
- name: Check release environment
18+
run: |
19+
bash ./bin/check-release-environment
20+
env:
21+
RELEASE_PLEASE_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
22+
SONATYPE_USERNAME: ${{ secrets.LLAMA_CLOUD_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
23+
SONATYPE_PASSWORD: ${{ secrets.LLAMA_CLOUD_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
24+
GPG_SIGNING_KEY: ${{ secrets.LLAMA_CLOUD_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }}
25+
GPG_SIGNING_PASSWORD: ${{ secrets.LLAMA_CLOUD_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release Please
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
release-please:
13+
if: github.repository == 'run-llama/llama-parse-java'
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1
18+
id: release
19+
with:
20+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}

‎.github/workflows/stlc-promote.yml‎

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Promote SDKs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
promote:
12+
runs-on: ubuntu-latest
13+
if: github.repository == 'run-llama/llamacloud-prod-java'
14+
env:
15+
PRODUCTION_REPO: run-llama/llama-parse-java
16+
GH_TOKEN: ${{ secrets.PRODUCTION_REPO_TOKEN }}
17+
steps:
18+
- name: Check out staging
19+
uses: actions/checkout@v6
20+
with:
21+
fetch-depth: 0
22+
persist-credentials: false
23+
24+
- name: Fetch production main
25+
run: |
26+
git remote add production \
27+
"https://x-access-token:${GH_TOKEN}@github.com/${PRODUCTION_REPO}.git"
28+
git fetch production main
29+
30+
- name: Check whether production already has staging's content
31+
id: diff
32+
run: |
33+
# Compare by CONTENT, not commit SHA. After a release, production
34+
# carries release-please's version/changelog commits that staging
35+
# lacks, so the SHAs always differ — a SHA check would re-open a
36+
# spurious release PR (and push staging's now-stale manifest) on
37+
# every push. Instead, ask whether merging staging into production
38+
# would change production's tree: if not, production already contains
39+
# everything on staging (it's equal, or only ahead by release
40+
# metadata) and there is nothing to release.
41+
MERGED=$(git merge-tree --write-tree production/main origin/main) || MERGED=conflict
42+
PRODUCTION_TREE=$(git rev-parse 'production/main^{tree}')
43+
if [ "$MERGED" = "$PRODUCTION_TREE" ]; then
44+
echo "Production already contains staging's content. Nothing to release."
45+
echo "synced=true" >> "$GITHUB_OUTPUT"
46+
else
47+
echo "synced=false" >> "$GITHUB_OUTPUT"
48+
fi
49+
50+
- name: Push staging main to the release branch on production
51+
if: steps.diff.outputs.synced == 'false'
52+
run: |
53+
git push production origin/main:refs/heads/stainless/release --force
54+
55+
- name: Open or update the release PR on production
56+
if: steps.diff.outputs.synced == 'false'
57+
run: |
58+
EXISTING_PR=$(gh pr list \
59+
--repo "${PRODUCTION_REPO}" \
60+
--head stainless/release \
61+
--state open \
62+
--json number \
63+
--jq '.[0].number')
64+
if [ -z "${EXISTING_PR}" ]; then
65+
gh pr create \
66+
--repo "${PRODUCTION_REPO}" \
67+
--base main \
68+
--head stainless/release \
69+
--title "Release SDK updates" \
70+
--body "$(git log --oneline production/main..origin/main)"
71+
else
72+
echo "Release PR #${EXISTING_PR} already exists. Force-push has updated it."
73+
fi
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Sync from production
2+
3+
on:
4+
schedule:
5+
# A poll, not a release — tune to how often releases/contributions land on
6+
# production. Every few hours is plenty; daily is fine.
7+
- cron: '17 */6 * * *'
8+
workflow_dispatch: {}
9+
10+
permissions:
11+
contents: write # push the back-sync branch on staging
12+
pull-requests: write # open/merge the back-sync PR on staging
13+
14+
concurrency:
15+
group: stlc-sync-from-production
16+
cancel-in-progress: true
17+
18+
jobs:
19+
sync:
20+
runs-on: ubuntu-latest
21+
if: github.repository == 'run-llama/llamacloud-prod-java'
22+
env:
23+
PRODUCTION_REPO: run-llama/llama-parse-java
24+
PRODUCTION_REPO_TOKEN: ${{ secrets.PRODUCTION_REPO_TOKEN }}
25+
# The built-in token writes the branch + PR on this (staging) repo.
26+
GH_TOKEN: ${{ github.token }}
27+
steps:
28+
- name: Check out staging
29+
uses: actions/checkout@v6
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Fetch production main
34+
run: |
35+
git remote add production \
36+
"https://x-access-token:${PRODUCTION_REPO_TOKEN}@github.com/${PRODUCTION_REPO}.git"
37+
git fetch production main
38+
39+
- name: Check whether production has content staging lacks
40+
id: diff
41+
run: |
42+
# Inverse of the promote guard, by content not commit SHA: would
43+
# merging production into staging change staging's tree? If not,
44+
# staging already has production's content — nothing to pull back.
45+
MERGED=$(git merge-tree --write-tree origin/main production/main) || MERGED=conflict
46+
STAGING_TREE=$(git rev-parse 'origin/main^{tree}')
47+
if [ "$MERGED" = "$STAGING_TREE" ]; then
48+
echo "Staging already has production's content. Nothing to pull back."
49+
echo "behind=false" >> "$GITHUB_OUTPUT"
50+
else
51+
echo "behind=true" >> "$GITHUB_OUTPUT"
52+
fi
53+
54+
- name: Push production main to the back-sync branch on staging
55+
if: steps.diff.outputs.behind == 'true'
56+
run: git push origin production/main:refs/heads/stlc/from-prod --force
57+
58+
- name: Open or update the back-sync PR on staging
59+
if: steps.diff.outputs.behind == 'true'
60+
run: |
61+
EXISTING_PR=$(gh pr list --head stlc/from-prod --base main --state open --json number --jq '.[0].number')
62+
if [ -z "${EXISTING_PR}" ]; then
63+
gh pr create \
64+
--base main \
65+
--head stlc/from-prod \
66+
--title "Sync release changes from production" \
67+
--body "Pulls production's release-please commits (and any merged contributions) back onto staging \`main\` so the next \`stlc build\` reseals against the released state. Bot-authored; safe to auto-merge."
68+
fi
69+
# Auto-merge so the loop is hands-off. If auto-merge isn't enabled on
70+
# the repo, the PR is left open for a one-click merge instead.
71+
gh pr merge stlc/from-prod --merge --auto \
72+
|| echo "Auto-merge unavailable — merge the back-sync PR manually."

‎.github/workflows/test.yml‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
- '!integrated/**'
7+
- '!stl-preview-head/**'
8+
- '!stl-preview-base/**'
9+
- '!generated'
10+
- '!codegen/**'
11+
- 'codegen/stl/**'
12+
pull_request:
13+
branches-ignore:
14+
- 'stl-preview-head/**'
15+
- 'stl-preview-base/**'
16+
17+
jobs:
18+
test:
19+
timeout-minutes: 15
20+
name: test
21+
runs-on: ubuntu-latest
22+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
23+
steps:
24+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25+
26+
- name: Set up Java
27+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
28+
with:
29+
distribution: temurin
30+
java-version: |
31+
8
32+
21
33+
cache: gradle
34+
35+
- name: Set up Gradle
36+
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0
37+
38+
- name: Run tests
39+
run: ./scripts/test

‎.release-please-manifest.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.0.1"
3+
}

‎.stats.yml‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
configured_endpoints: 131
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamaindex-Georgehe4/llamacloud-prod-76b59acff99524099afaddec7a3d8cfebfd1ecc096e57284722bcd26b39e466e.yml
3-
openapi_spec_hash: b52d9f7ba54524c4dd975fe53dd8e94e
4-
config_hash: a65cacd5ca98538ef6f5e6ac330f25a9
1+
configured_endpoints: 136

0 commit comments

Comments
 (0)