Skip to content

Commit

Permalink
GH-257: feat: Publish springwolf-add-ons/springwolf-common-model-conv…
Browse files Browse the repository at this point in the history
…erters
  • Loading branch information
timonback authored and sam0r040 committed Jul 21, 2023
1 parent 43af636 commit 421ab21
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 16 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/publish-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,42 @@ jobs:
env:
ORG_GRADLE_PROJECT_SNAPSHOT: false



publish-springwolf-add-ons-common-model-converters-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

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

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Publish package
run: ./gradlew -p springwolf-add-ons/springwolf-common-model-converters publish
env:
ORG_GRADLE_PROJECT_SNAPSHOT: false
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGKEY}}
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD}}
ORG_GRADLE_PROJECT_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

- name: Tag version
run: |
VERSION=$(./gradlew -p springwolf-add-ons/springwolf-common-model-converters properties | grep "version:" | awk '{print $2}')
TAG="springwolf-common-model-converters-$VERSION"
git tag "$TAG"
echo "Publishing tag"
git push origin "$TAG" || true # Do not fail, if the tag already exists
env:
ORG_GRADLE_PROJECT_SNAPSHOT: false

publish-springwolf-ui-release:
runs-on: ubuntu-latest
steps:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/springwolf-common-model-converters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: springwolf-common-model-converters

on:
push:
branches:
- master
paths:
- '.github/workflows/springwolf-common-model-converters.yml'
- 'springwolf-add-ons/springwolf-common-model-converters/**'
pull_request:
types: [ opened, synchronize, ready_for_review ]

env:
addon: springwolf-add-ons/springwolf-common-model-converters

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

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

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run unit tests
run: ./gradlew -p ${{ env.addon }} test

- name: Publish package
if: github.ref == 'refs/heads/master'
run: ./gradlew -p ${{ env.addon }} publish
env:
ORG_GRADLE_PROJECT_SNAPSHOT: true

ORG_GRADLE_PROJECT_SIGNINGKEY: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGKEY}}
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD}}

ORG_GRADLE_PROJECT_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
49 changes: 33 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# <img src="logo.png" alt="Logo" width="100"/> Springwolf Core

##### Automated documentation for AsyncAPIs built with Spring Boot

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
![springwolf-core](https://github.com/springwolf/springwolf-core/workflows/springwolf-core/badge.svg)
![springwolf-kafka](https://github.com/springwolf/springwolf-core/workflows/springwolf-kafka/badge.svg)
![springwolf-amqp](https://github.com/springwolf/springwolf-core/workflows/springwolf-amqp/badge.svg)
![springwolf-cloud-stream](https://github.com/springwolf/springwolf-core/workflows/springwolf-cloud-stream/badge.svg)
![springwolf-common-model-converters](https://github.com/springwolf/springwolf-core/actions/workflows/springwolf-common-model-converters.yml/badge.svg)

> We are on discord for any question, discussion, request etc.
> Join us at https://discord.gg/HZYqd5RPTd
### Table Of Contents

- [About](#about)
- [Demo](#demo)
- [Documentation](#documentation)
Expand All @@ -20,46 +23,57 @@
- [Development](#development)

### About

This project is inspired by [Springfox](https://github.com/springfox/springfox), but instead of documenting REST APIs,
it documents async APIs.
it documents async APIs.

The resulting document is compliant with the [asyncapi specification](https://www.asyncapi.com/) and is provided as a
The resulting document is compliant with the [asyncapi specification](https://www.asyncapi.com/) and is provided as a
web UI, much like that of Springfox, and allows easy publishing of autogenerated payload examples.

### Demo

You can take a look at a [live demo of springwolf](https://demo.springwolf.dev/).

### Documentation

Springwolf documentation is available at [here](https://www.springwolf.dev/docs/quickstart).

### Supported protocols

- Kafka
- AMQP (RabbitMQ)

### Why you should use it
In projects using async APIs, you may often find yourself needing to manually send a message to some topic, whether if you

In projects using async APIs, you may often find yourself needing to manually send a message to some topic, whether if
you
are manually testing a new feature, debugging or trying to understand some flow. This requires:

1. Instantiating a payload object
2. Serializing your payload object
3. Publishing it by the CLI or some other interface.
2. Serializing your payload object
3. Publishing it by the CLI or some other interface.

Springwolf exploits the fact you already fully described your consumer endpoint (with listener annotations, such as
`@KafkaListner`, `@RabbitListener` etc.) and automatically generates an example payload object for the appropriate payload and allows you
Springwolf exploits the fact you already fully described your consumer endpoint (with listener annotations, such as
`@KafkaListner`, `@RabbitListener` etc.) and automatically generates an example payload object for the appropriate
payload and allows you
to publish it to the correct channel with a single click.

### Usage & Example

| Code / Plugin | Example project | Current version | SNAPSHOT version |
|-----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Core](https://github.com/springwolf/springwolf-core/tree/master/springwolf-core) | | | |
| [AMQP](https://github.com/springwolf/springwolf-core/tree/master/springwolf-plugins/springwolf-amqp-plugin) | [AMQP Example](https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples/springwolf-amqp-example) | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-amqp?color=green&label=springwolf-amqp&style=plastic) | ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.springwolf/springwolf-amqp?label=springwolf-amqp&server=https%3A%2F%2Fs01.oss.sonatype.org&style=plastic) |
| [Cloud Stream](https://github.com/springwolf/springwolf-core/tree/master/springwolf-plugins/springwolf-cloud-stream-plugin) | [Cloud Stream Example](https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples/springwolf-cloud-stream-example) | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-cloud-stream?color=green&label=springwolf-cloud-stream&style=plastic) | ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.springwolf/springwolf-cloud-stream?label=springwolf-cloud-stream&server=https%3A%2F%2Fs01.oss.sonatype.org&style=plastic) |
| [Kafka](https://github.com/springwolf/springwolf-core/tree/master/springwolf-plugins/springwolf-kafka-plugin) | [Kafka Example](https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples/springwolf-kafka-example) | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-kafka?color=green&label=springwolf-kafka&style=plastic) | ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.springwolf/springwolf-kafka?label=springwolf-kafka&server=https%3A%2F%2Fs01.oss.sonatype.org&style=plastic) |

| Code / Plugin / Addon | Example project | Current version | SNAPSHOT version |
|-------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Core](https://github.com/springwolf/springwolf-core/tree/master/springwolf-core) | | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-core?color=green&label=springwolf-core&style=plastic) | ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.springwolf/springwolf-core?label=springwolf-core&server=https%3A%2F%2Fs01.oss.sonatype.org&style=plastic) |
| [AMQP](https://github.com/springwolf/springwolf-core/tree/master/springwolf-plugins/springwolf-amqp-plugin) | [AMQP Example](https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples/springwolf-amqp-example) | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-amqp?color=green&label=springwolf-amqp&style=plastic) | ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.springwolf/springwolf-amqp?label=springwolf-amqp&server=https%3A%2F%2Fs01.oss.sonatype.org&style=plastic) |
| [Cloud Stream](https://github.com/springwolf/springwolf-core/tree/master/springwolf-plugins/springwolf-cloud-stream-plugin) | [Cloud Stream Example](https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples/springwolf-cloud-stream-example) | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-cloud-stream?color=green&label=springwolf-cloud-stream&style=plastic) | ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.springwolf/springwolf-cloud-stream?label=springwolf-cloud-stream&server=https%3A%2F%2Fs01.oss.sonatype.org&style=plastic) |
| [Kafka](https://github.com/springwolf/springwolf-core/tree/master/springwolf-plugins/springwolf-kafka-plugin) | [Kafka Example](https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples/springwolf-kafka-example) | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-kafka?color=green&label=springwolf-kafka&style=plastic) | ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.springwolf/springwolf-kafka?label=springwolf-kafka&server=https%3A%2F%2Fs01.oss.sonatype.org&style=plastic) |
| [Common Model Converter](https://github.com/springwolf/springwolf-core/tree/master/springwolf-add-ons/springwolf-common-model-converters) | | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-common-model-converters?color=green&label=springwolf-common-model-converters&style=plastic) | ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.springwolf/springwolf-common-model-converters?label=springwolf-common-model-converters&server=https%3A%2F%2Fs01.oss.sonatype.org&style=plastic) |

### Development

#### Sonatype snapshots

Add the following to the `repositories` closure in `build.gradle`:

```groovy
repositories {
// ...
Expand All @@ -70,8 +84,10 @@ repositories {
```

Or add the `repository` to your `pom.xml` if you are using maven:

```xml
<repositories>

<repositories>
<repository>
<id>oss-sonatype</id>
<name>oss-sonatype</name>
Expand All @@ -80,8 +96,9 @@ Or add the `repository` to your `pom.xml` if you are using maven:
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</repositories>
```

#### Local Snapshots

To work with local snapshots, run the `publishToMavenLocal` task with `-Dsnapshot=true`.

0 comments on commit 421ab21

Please sign in to comment.