This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d936b70
commit 3f43570
Showing
11 changed files
with
185 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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,32 @@ | ||
name: "Library publishing" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- client-common/** | ||
- marudor-client/** | ||
- regenbogen-ice-client/** | ||
- träwelling-client/** | ||
|
||
env: | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_KEY_PASSWORD }} | ||
JFROG_KEY: ${{ secrets.JFROG_KEY }} | ||
JFROG_USER: ${{ secrets.JFROG_USER }} | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 18 | ||
uses: actions/setup-java@v1 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 18 | ||
- name: Publish with Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: publishAllPublicationsToMavenRepository |
This file contains 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 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 |
---|---|---|
|
@@ -67,7 +67,7 @@ signing { | |
) | ||
|
||
publishing.publications.withType<MavenPublication> { | ||
//sign(this) | ||
sign(this) | ||
} | ||
} | ||
|
||
|
This file contains 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 |
Binary file not shown.
This file contains 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
9 changes: 9 additions & 0 deletions
9
...monMain/kotlin/dev/schlaubi/hafalsch/rainbow_ice/annotations/ExperimentalRainbowICEApi.kt
This file contains 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,9 @@ | ||
package dev.schlaubi.hafalsch.rainbow_ice.annotations | ||
|
||
/** | ||
* Annotation marking experimental rainbow ice apis. | ||
*/ | ||
@Target(AnnotationTarget.CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION) | ||
@MustBeDocumented | ||
@RequiresOptIn | ||
public annotation class ExperimentalRainbowICEApi |
12 changes: 12 additions & 0 deletions
12
...ogen-ice-client/src/commonMain/kotlin/dev/schlaubi/hafalsch/rainbow_ice/entity/Station.kt
This file contains 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,12 @@ | ||
package dev.schlaubi.hafalsch.rainbow_ice.entity | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
/** | ||
* Representation of a train station. | ||
* | ||
* @property evaNumber the eva (or IBNR) of the station | ||
* @property name the name of the station | ||
*/ | ||
@Serializable | ||
public data class Station(val evaNumber: Int, val name: String) |
This file contains 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
75 changes: 68 additions & 7 deletions
75
...n-ice-client/src/commonMain/kotlin/dev/schlaubi/hafalsch/rainbow_ice/routes/RainbowICE.kt
This file contains 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 |
---|---|---|
@@ -1,23 +1,84 @@ | ||
package dev.schlaubi.hafalsch.rainbow_ice.routes | ||
|
||
import dev.schlaubi.hafalsch.rainbow_ice.annotations.ExperimentalRainbowICEApi | ||
import dev.schlaubi.hafalsch.rainbow_ice.entity.TrainVehicle as TrainVehicleEntity | ||
import io.ktor.resources.* | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
/** | ||
* Mapping of [Regenbogen ICE API](https://github.com/regenbogen-ice/api). | ||
*/ | ||
@Resource("") | ||
@Serializable | ||
public class RainbowICE { | ||
|
||
/** | ||
* Returns an RSS feed for the `Regenbogen ICE`. | ||
*/ | ||
@Serializable | ||
@Resource("rss") | ||
public data class Rss(val rainbowICE: RainbowICE = RainbowICE()) { | ||
|
||
/** | ||
* Returns an RSS feed for the `Regenbogen ICE` at [station]. | ||
*/ | ||
@Serializable | ||
@Resource("{station}") | ||
public data class ForStation(val station: String, val rss: Rss = Rss()) | ||
} | ||
|
||
/** | ||
* Provides station autocomplete for [query]. | ||
* | ||
* **This only includes long distance travel stations** | ||
*/ | ||
@Serializable | ||
@Resource("stationSearch/{query}") | ||
public data class StationSearch(val query: String, val rainbowICE: RainbowICE = RainbowICE()) | ||
|
||
/** | ||
* Provides train autocomplete for [query] (TZn and name). | ||
*/ | ||
@Serializable | ||
@Resource("autocomplete/{query}") | ||
public data class Autocomplete(val query: String, val rainbowICE: RainbowICE = RainbowICE()) | ||
|
||
/** | ||
* Meta-class for `/train_vehicle` route. | ||
*/ | ||
@Serializable | ||
@Resource("train_vehicle") | ||
public data class TrainVehicle( | ||
@SerialName("q") val query: String, | ||
@SerialName("trip_limit") val tripLimit: Int? = null, | ||
@SerialName("include_routes") val includeRoutes: Boolean? = null, | ||
@SerialName("include_marudor_link") val includeMarudorLink: Boolean? = null, | ||
val rainbowICE: RainbowICE = RainbowICE() | ||
) | ||
public data class TrainVehicle(val rainbowICE: RainbowICE = RainbowICE()) { | ||
/** | ||
* Fetches [train information][TrainVehicleEntity] for [query]. | ||
* | ||
* @property tripLimit How many [trips][TrainVehicleEntity.trips] to fetch | ||
* @property includeRoutes whether to include [TrainVehicleEntity.trips] | ||
* @property includeMarudorLink whether to include [TrainVehicleEntity.Trip.marudor] | ||
*/ | ||
@Serializable | ||
@Resource("") | ||
public data class Specific( | ||
@SerialName("q") val query: String, | ||
@SerialName("trip_limit") val tripLimit: Int? = null, | ||
@SerialName("include_routes") val includeRoutes: Boolean? = null, | ||
@SerialName("include_marudor_link") val includeMarudorLink: Boolean? = null, | ||
val trainVehicle: TrainVehicle = TrainVehicle() | ||
) | ||
|
||
|
||
/** | ||
* Probably retrieves all trains. | ||
* | ||
* **This api exists in the code, however does not exist on the production instance** | ||
* | ||
* https://github.com/regenbogen-ice/api/blob/canary/src/webserver/paths/train_vehicle.ts#L124-L132 exists | ||
* however https://regenbogen-ice.de/api/train_vehicle/all returns 404 | ||
*/ | ||
@ExperimentalRainbowICEApi | ||
@Serializable | ||
@Resource("all") | ||
public data class All(val trainVehicle: TrainVehicle = TrainVehicle()) | ||
} | ||
} |