Skip to content
Merged
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
20 changes: 17 additions & 3 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generate code and create release
name: Generate code, create release and tag repo

on:
workflow_dispatch:
Expand Down Expand Up @@ -62,24 +62,38 @@ jobs:
working-directory: ./python/generated-library
run: |
poetry version ${{ env.RELEASE_VERSION }}

- name: build wheel
working-directory: ./python/generated-library
run: |
poetry build

- name: Generate Java lib
working-directory: ./java
run: |
./generate.sh

- name: Set Java lib version and build
- name: Set Java lib version
working-directory: ./java/aicockpit-jar
run: |
echo "new version manually set to ${{ env.RELEASE_VERSION }}"
mvn -B build-helper:parse-version versions:set -DnewVersion=${{ env.RELEASE_VERSION }} versions:commit --settings ${{ github.workspace }}/.github/workflows/settings.xml

- name: Build Java lib
working-directory: ./java/aicockpit-jar
run: |
mvn package --settings ${{ github.workspace }}/.github/workflows/settings.xml
env:
CI: false
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
MAVEN_GPG_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}

- name: Get tag name
run: |
echo "TAG=${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV

- name: Create github release
run: gh release create ${{ env.TAG }} -F CHANGELOG.md
run: gh release create ${{ env.TAG }} -F CHANGELOG.md ./java/aicockpit-jar/target/*.jar ./java/aicockpit-jar/target/*.asc ./python/generated-library/dist/*.whl ./python/generated-library/dist/*.tar.gz
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,17 @@ jobs:
- name: Generate Java lib
working-directory: ./java
run: |
./generate.sh
./generate.sh

- name: Try to build Java lib
working-directory: ./java/aicockpit-jar
run: |
mvn package --settings ${{ github.workspace }}/.github/workflows/settings.xml
ls -al ./target
env:
CI: false
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
MAVEN_GPG_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}

build-python:
name: "Build Python"
Expand Down Expand Up @@ -75,4 +85,10 @@ jobs:
- name: Set Python lib version
working-directory: ./python/generated-library
run: |
poetry version ${{ env.RELEASE_VERSION }}
poetry version ${{ env.RELEASE_VERSION }}

- name: build wheel
working-directory: ./python/generated-library
run: |
poetry build
ls ./dist
69 changes: 66 additions & 3 deletions .github/workflows/publish-libraries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,72 @@ on:

permissions:
contents: write
id-token: write

env:
RELEASE_VERSION: ${{ github.event.inputs.RELEASE_VERSION }}
PYTHON_PACKAGE_NAME: starwit_aic_api

jobs:
publish_libs:
name: "Publish libraries"
publish_python_lib:
name: "Publish Python library"
runs-on: [self-hosted, linux, X64]
environment:
name: pypi
url: https://pypi.org/p/${{ env.PYTHON_PACKAGE_NAME }}

steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: '0'
ref: ${{ env.RELEASE_VERSION }}

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Set up openapi-generator-cli
run: |
npm install @openapitools/openapi-generator-cli -g

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Set Python lib version
working-directory: ./python/generated-library
run: |
poetry version ${{ env.RELEASE_VERSION }}

- name: build wheel
working-directory: ./python/generated-library
run: |
poetry build
ls ./dist

#- name: Publish package distributions to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# packages-dir: ./python/generated-library/dist

publish_java_lib:
name: "Publish Java library"
runs-on: [self-hosted, linux, X64]

steps:
- name: checkout
uses: actions/checkout@v5
with:
fetch-depth: '0'
ref: ${{ env.RELEASE_VERSION }}
Expand All @@ -35,6 +89,15 @@ jobs:
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.2

- name: check git tag
run: git status

- name: Set Java lib version
working-directory: ./java/aicockpit-jar
run: |
echo "new version manually set to ${{ env.RELEASE_VERSION }}"
mvn -B build-helper:parse-version versions:set -DnewVersion=${{ env.RELEASE_VERSION }} versions:commit --settings ${{ github.workspace }}/.github/workflows/settings.xml

- name: Build Maven project
working-directory: ./java/aicockpit-jar
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,18 @@ For other Java build tools, please refer to their respective documentation, to u
Add the following to your `pyproject.toml` dependencies section:\
`starwit_aic_api = { git = "https://github.com/starwit/starwit-aic-api.git", subdirectory = "python/generated-library", tag = "0.0.9" }`

TODO publishing to PyPi.

## Dev

This repo is not supposed to see actual development activity. Ir shall only contain generated code for various languages and is being used to publish libraries for each supported programming languages.

### Publish

Workflow [publish](.github/workflows/publish-libraries.yaml) is supposed to release Java lib to Maven Central and Python package to PyPi. You have to provide release version number, to publish artifact.

In Maven central an uploaded library still has to be manually approved for publication. You have to use proper login at https://central.sonatype.com/.

### Run/Debug Github Actions locally
`act -W .github/workflows/create-release.yaml --input-file local.inputs --secret-file local.secrets -P self-hosted=-self-hosted`

Expand Down
6 changes: 3 additions & 3 deletions java/aicockpit-jar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>de.starwit.aic</groupId>
<artifactId>aicockpit-api</artifactId>
<version>0.1.5</version>
<version>0.1.6</version>
<name>AI Cockpit interface API</name>
<description>Data model for AI Cockpit interfaces</description>
<url>http://starwit.de</url>
Expand Down Expand Up @@ -75,7 +75,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
<version>2.13.1</version>
</dependency>
<dependency>
<groupId>io.gsonfire</groupId>
Expand All @@ -90,7 +90,7 @@
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>3.9.0</version>
<version>3.12.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* <p>ApiException class.</p>
*/
@SuppressWarnings("serial")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-07-04T12:43:11.182602420Z[Etc/UTC]", comments = "Generator version: 7.13.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-08-21T09:43:09.059871871Z[Etc/UTC]", comments = "Generator version: 7.13.0")
public class ApiException extends Exception {
private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
/**
* AIModel
*/
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-07-04T12:43:11.182602420Z[Etc/UTC]", comments = "Generator version: 7.13.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-08-21T09:43:09.059871871Z[Etc/UTC]", comments = "Generator version: 7.13.0")
public class AIModel {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* Abstract class for oneOf,anyOf schemas defined in OpenAPI spec
*/
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-07-04T12:43:11.182602420Z[Etc/UTC]", comments = "Generator version: 7.13.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-08-21T09:43:09.059871871Z[Etc/UTC]", comments = "Generator version: 7.13.0")
public abstract class AbstractOpenApiSchema {

// store the actual instance of the schema/object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
/**
* An actual action that a system executes
*/
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-07-04T12:43:11.182602420Z[Etc/UTC]", comments = "Generator version: 7.13.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-08-21T09:43:09.059871871Z[Etc/UTC]", comments = "Generator version: 7.13.0")
public class Action {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
/**
* A type of action that a system can execute
*/
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-07-04T12:43:11.182602420Z[Etc/UTC]", comments = "Generator version: 7.13.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-08-21T09:43:09.059871871Z[Etc/UTC]", comments = "Generator version: 7.13.0")
public class ActionType {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
/**
* An actual decision that a system made
*/
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-07-04T12:43:11.182602420Z[Etc/UTC]", comments = "Generator version: 7.13.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-08-21T09:43:09.059871871Z[Etc/UTC]", comments = "Generator version: 7.13.0")
public class Decision {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
/**
* A type of decision that a system can derive
*/
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-07-04T12:43:11.182602420Z[Etc/UTC]", comments = "Generator version: 7.13.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-08-21T09:43:09.059871871Z[Etc/UTC]", comments = "Generator version: 7.13.0")
public class DecisionType {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
/**
* Info
*/
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-07-04T12:43:11.182602420Z[Etc/UTC]", comments = "Generator version: 7.13.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-08-21T09:43:09.059871871Z[Etc/UTC]", comments = "Generator version: 7.13.0")
public class Info {
public static final String SERIALIZED_NAME_GENERATION_DATE = "generation-date";
@SerializedName(SERIALIZED_NAME_GENERATION_DATE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
/**
* Module
*/
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-07-04T12:43:11.182602420Z[Etc/UTC]", comments = "Generator version: 7.13.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-08-21T09:43:09.059871871Z[Etc/UTC]", comments = "Generator version: 7.13.0")
public class Module {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
/**
* ModuleSBOMLocationValue
*/
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-07-04T12:43:11.182602420Z[Etc/UTC]", comments = "Generator version: 7.13.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-08-21T09:43:09.059871871Z[Etc/UTC]", comments = "Generator version: 7.13.0")
public class ModuleSBOMLocationValue {
public static final String SERIALIZED_NAME_URL = "url";
@SerializedName(SERIALIZED_NAME_URL)
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion python/generated-library/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "starwit_aic_api"
version = "0.1.5"
version = "0.1.6"
description = ""
authors = ["flonix8 <flstanek@googlemail.com>"]
readme = "README.md"
Expand Down