Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'
architecture: x64

- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Build artifacts
run: mvn clean install
84 changes: 84 additions & 0 deletions .github/workflows/daily-model-generation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Daily Model Generation

on:
push:
branches:
- actions
schedule:
# Run at 1 AM UTC every day
- cron: '0 1 * * *'
workflow_dispatch: # Allow manual triggering

permissions:
contents: write
pull-requests: write

jobs:
generate-models:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'
architecture: x64

- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Generate models from OpenAPI spec
run: mvn -Pgenerate-models

- name: Check for changes
id: git-check
run: |
git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT

- name: Create Pull Request
if: steps.git-check.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore: update generated models from OpenAPI spec'
branch: automated/model-generation-${{ github.run_number }}
delete-branch: true
title: 'chore: Update generated models from OpenAPI spec'
body: |
## Automated Model Generation

This PR contains automatically generated updates to the SDK models based on the latest OpenAPI specification from `https://api.prime.coinbase.com/v1/openapi.yaml`.

### What changed?
- Models generated/updated via `mvn -Pgenerate-models`
- Changes reflect updates to the Prime API specification

### How to review
1. Verify that generated files follow SDK conventions
2. Check that new models have proper Builder patterns and license headers
3. Ensure enums are properly generated
4. Run tests to verify compatibility: `mvn clean install`

### Generated by
Workflow: `${{ github.workflow }}`
Run: `${{ github.run_id }}`
Triggered: `${{ github.event_name }}`
labels: |
automated
model-generation
assignees: ${{ github.repository_owner }}

- name: No changes detected
if: steps.git-check.outputs.changes != 'true'
run: echo "No model changes detected. Skipping PR creation."
31 changes: 17 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.7.0</version>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.9.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>published</waitUntil>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -184,16 +184,19 @@
</build>
</profile>
</profiles>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repositories>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<name>Central Portal Snapshots</name>
<id>central-portal-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</distributionManagement>
</repositories>
<dependencies>
<dependency>
<groupId>com.coinbase.core</groupId>
Expand Down