-
Notifications
You must be signed in to change notification settings - Fork 0
feat(sdk): publish gemini-markets TypeScript SDK #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+43,848
−5
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
69d78a0
feat(sdk): add TypeScript SDK with CI, changesets, and npm publish pi…
gl00mt1t4n 38e596e
release(sdk): prepare initial gemini-markets publication
gl00mt1t4n 9ad6416
ci(sdk): require changesets for SDK changes
gl00mt1t4n e8b0a4d
release(sdk): publish scoped beta package
gl00mt1t4n File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,68 @@ | ||
| name: SDK CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "packages/sdk-typescript/**" | ||
| - ".github/workflows/sdk-ci.yml" | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - "packages/sdk-typescript/**" | ||
| - ".github/workflows/sdk-ci.yml" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: packages/sdk-typescript | ||
|
|
||
| jobs: | ||
| build-and-test: | ||
| runs-on: gha-runner-scale-set-standard | ||
| timeout-minutes: 15 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| with: | ||
| node-version: "22" | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build | ||
| run: npm run build | ||
|
|
||
| - name: Typecheck | ||
| run: npm run typecheck | ||
|
|
||
| - name: Test | ||
| run: npm test | ||
|
|
||
| - name: Require Changeset | ||
| run: npm run verify:changeset | ||
| if: github.event_name == 'pull_request' | ||
| - name: Verify package (browser imports + bundle + pack) | ||
| run: npm run verify:package | ||
|
|
||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 | ||
| continue-on-error: true | ||
| with: | ||
| bun-version: "1.x" | ||
|
|
||
| - name: Setup Deno | ||
| uses: denoland/setup-deno@4606d5cc6fb3f673efd4f594850e3f4b3e9d29cd # v2 | ||
| continue-on-error: true | ||
| with: | ||
| deno-version: v2.x | ||
|
|
||
| - name: Verify multi-runtime (Node, Bun, Deno) | ||
| run: npm run verify:runtimes | ||
| continue-on-error: true |
This file contains hidden or 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,55 @@ | ||
| name: SDK Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - "packages/sdk-typescript/package.json" | ||
| - "packages/sdk-typescript/.changeset/**" | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| id-token: write | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: packages/sdk-typescript | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: gha-runner-scale-set-standard | ||
| timeout-minutes: 15 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| with: | ||
| node-version: "22" | ||
| registry-url: "https://registry.npmjs.org" | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build | ||
| run: npm run build | ||
|
|
||
| - name: Test | ||
| run: npm test | ||
|
|
||
| - name: Verify package | ||
| run: npm run verify:package | ||
|
|
||
| - name: Create Release Pull Request or Publish | ||
| uses: changesets/action@c8bada60c408975afd1a20b3db81d6eee6789308 # v1.4.9 | ||
| with: | ||
| version: npx --no-install changeset version | ||
| publish: npm publish --tag beta --provenance | ||
| cwd: packages/sdk-typescript | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains hidden or 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,74 @@ | ||
| name: SDK Smoke Test | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| environment: | ||
| description: "Target environment" | ||
| required: true | ||
| default: "sandbox" | ||
| type: choice | ||
| options: | ||
| - sandbox | ||
| - production | ||
| market-type: | ||
| description: "Market type to smoke test" | ||
| required: true | ||
| default: "market-data" | ||
| type: choice | ||
| options: | ||
| - market-data | ||
| - prediction-markets | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: packages/sdk-typescript | ||
|
|
||
| jobs: | ||
| smoke: | ||
| runs-on: gha-runner-scale-set-standard | ||
| timeout-minutes: 10 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| with: | ||
| node-version: "22" | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build | ||
| run: npm run build | ||
|
|
||
| - name: Run smoke test | ||
| run: | | ||
| GEMINI_SMOKE_ENV=${{ inputs.environment }} \ | ||
| node scripts/smoke-sandbox.mjs --market-type=${{ inputs.market-type }} | ||
| env: | ||
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
| GEMINI_API_SECRET: ${{ secrets.GEMINI_API_SECRET }} | ||
|
|
||
| - name: Verify REST operations | ||
| if: inputs.environment == 'sandbox' | ||
| run: | | ||
| GEMINI_SMOKE_ENV=sandbox \ | ||
| node scripts/verify-sandbox-rest.mjs | ||
| env: | ||
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
| GEMINI_API_SECRET: ${{ secrets.GEMINI_API_SECRET }} | ||
|
|
||
| - name: Verify market data | ||
| if: inputs.market-type == 'market-data' | ||
| run: | | ||
| GEMINI_MD_ENV=${{ inputs.environment }} \ | ||
| node scripts/verify-market-data-live.mjs | ||
|
gl00mt1t4n marked this conversation as resolved.
Dismissed
|
||
| env: | ||
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
| GEMINI_API_SECRET: ${{ secrets.GEMINI_API_SECRET }} | ||
This file contains hidden or 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 hidden or 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,8 @@ | ||
| # Changesets | ||
|
|
||
| Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
| with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
| find the full documentation for it [in our repository](https://github.com/changesets/changesets). | ||
|
|
||
| We have a quick list of common questions to get you started engaging with this project in | ||
| [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md). |
This file contains hidden or 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,10 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/@changesets/config@3.1.4/schema.json", | ||
| "changelog": "@changesets/cli/changelog", | ||
| "commit": false, | ||
| "fixed": [], | ||
| "linked": [], | ||
| "access": "public", | ||
| "baseBranch": "main", | ||
| "updateInternalDependencies": "patch" | ||
| } |
This file contains hidden or 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,5 @@ | ||
| --- | ||
| "@gemini-markets/sdk": minor | ||
| --- | ||
|
|
||
| Initial public release of the Gemini Markets TypeScript SDK. |
This file contains hidden or 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,8 @@ | ||
| { | ||
| "mode": "pre", | ||
| "tag": "beta", | ||
| "initialVersions": { | ||
| "@gemini-markets/sdk": "0.0.0" | ||
| }, | ||
| "changesets": [] | ||
| } |
This file contains hidden or 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,2 @@ | ||
| node_modules/ | ||
| dist/ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.