Skip to content

Commit

Permalink
chore: go live (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Oct 7, 2024
1 parent e475fd4 commit b283194
Show file tree
Hide file tree
Showing 67 changed files with 523 additions and 2,978 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/publish-sonatype.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to Sonatype in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/OneBusAway/kotlin-sdk/actions/workflows/publish-sonatype.yml
name: Publish Sonatype
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: |
8
17
cache: gradle

- name: Set up Gradle
uses: gradle/gradle-build-action@v2

- name: Publish to Sonatype
run: |
./gradlew --parallel --no-daemon publish
env:
SONATYPE_USERNAME: ${{ secrets.ONEBUSAWAY_SDK_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.ONEBUSAWAY_SDK_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
GPG_SIGNING_KEY_ID: ${{ secrets.ONEBUSAWAY_SDK_SONATYPE_GPG_SIGNING_KEY_ID || secrets.GPG_SIGNING_KEY_ID }}
GPG_SIGNING_KEY: ${{ secrets.ONEBUSAWAY_SDK_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_PASSWORD: ${{ secrets.ONEBUSAWAY_SDK_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }}
25 changes: 25 additions & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release Doctor
on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
release_doctor:
name: release doctor
runs-on: ubuntu-latest
if: github.repository == 'OneBusAway/kotlin-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v4

- name: Check release environment
run: |
bash ./bin/check-release-environment
env:
SONATYPE_USERNAME: ${{ secrets.ONEBUSAWAY_SDK_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.ONEBUSAWAY_SDK_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
GPG_SIGNING_KEY_ID: ${{ secrets.ONEBUSAWAY_SDK_SONATYPE_GPG_SIGNING_KEY_ID || secrets.GPG_SIGNING_KEY_ID }}
GPG_SIGNING_KEY: ${{ secrets.ONEBUSAWAY_SDK_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_PASSWORD: ${{ secrets.ONEBUSAWAY_SDK_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }}
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.0.1-alpha.0"
}
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The REST API documentation can be found on [developer.onebusaway.org](https://d

#### Gradle

<!-- x-release-please-start-version -->

```kotlin
implementation("org.onebusaway:onebusaway-sdk-kotlin:0.0.1-alpha.0")
```
Expand All @@ -32,6 +34,8 @@ implementation("org.onebusaway:onebusaway-sdk-kotlin:0.0.1-alpha.0")
</dependency>
```

<!-- x-release-please-end -->

### Configure the client

Use `OnebusawaySdkOkHttpClient.builder()` to configure the client. At a minimum you need to set `.apiKey()`:
Expand Down Expand Up @@ -215,7 +219,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/open-transit-kotlin/issues) with questions, bugs, or suggestions.
We are keen for your feedback; please open an [issue](https://www.github.com/OneBusAway/kotlin-sdk/issues) with questions, bugs, or suggestions.

## Requirements

Expand Down
33 changes: 33 additions & 0 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

errors=()

if [ -z "${SONATYPE_USERNAME}" ]; then
errors+=("The ONEBUSAWAY_SDK_SONATYPE_USERNAME secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi

if [ -z "${SONATYPE_PASSWORD}" ]; then
errors+=("The ONEBUSAWAY_SDK_SONATYPE_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi

if [ -z "${GPG_SIGNING_KEY}" ]; then
errors+=("The ONEBUSAWAY_SDK_SONATYPE_GPG_SIGNING_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi

if [ -z "${GPG_SIGNING_PASSWORD}" ]; then
errors+=("The ONEBUSAWAY_SDK_SONATYPE_GPG_SIGNING_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi

lenErrors=${#errors[@]}

if [[ lenErrors -gt 0 ]]; then
echo -e "Found the following errors in the release environment:\n"

for error in "${errors[@]}"; do
echo -e "- $error\n"
done

exit 1
fi

echo "The environment is ready to push releases!"
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

allprojects {
group = "org.onebusaway"
version = "0.0.1-alpha.0"
version = "0.0.1-alpha.0" // x-release-please-version
}

nexusPublishing {
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/onebusaway-sdk.java.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ configure<SpotlessExtension> {
importOrder()
removeUnusedImports()
palantirJavaFormat()
toggleOffOn()
}
}

Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/onebusaway-sdk.kotlin.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ kotlin {
configure<SpotlessExtension> {
kotlin {
ktfmt().kotlinlangStyle()
toggleOffOn()
}
}

Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/onebusaway-sdk.publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ configure<PublishingExtension> {
}

scm {
connection.set("scm:git:git://github.com/stainless-sdks/open-transit-kotlin.git")
developerConnection.set("scm:git:git://github.com/stainless-sdks/open-transit-kotlin.git")
url.set("https://github.com/stainless-sdks/open-transit-kotlin")
connection.set("scm:git:git://github.com/OneBusAway/kotlin-sdk.git")
developerConnection.set("scm:git:git://github.com/OneBusAway/kotlin-sdk.git")
url.set("https://github.com/OneBusAway/kotlin-sdk")
}

versionMapping {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ constructor(
return true
}

return other is OnebusawaySdkError &&
this.additionalProperties == other.additionalProperties
return /* spotless:off */ other is OnebusawaySdkError && this.additionalProperties == other.additionalProperties /* spotless:on */
}

override fun hashCode(): Int {
return Objects.hash(additionalProperties)
return /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */
}

override fun toString() = "OnebusawaySdkError{additionalProperties=$additionalProperties}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ constructor(
return true
}

return other is AgenciesWithCoverageListParams &&
this.additionalQueryParams == other.additionalQueryParams &&
this.additionalHeaders == other.additionalHeaders
return /* spotless:off */ other is AgenciesWithCoverageListParams && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */
}

override fun hashCode(): Int {
return Objects.hash(additionalQueryParams, additionalHeaders)
return /* spotless:off */ Objects.hash(additionalQueryParams, additionalHeaders) /* spotless:on */
}

override fun toString() =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,28 +390,14 @@ private constructor(
return true
}

return other is List &&
this.agencyId == other.agencyId &&
this.lat == other.lat &&
this.latSpan == other.latSpan &&
this.lon == other.lon &&
this.lonSpan == other.lonSpan &&
this.additionalProperties == other.additionalProperties
return /* spotless:off */ other is List && this.agencyId == other.agencyId && this.lat == other.lat && this.latSpan == other.latSpan && this.lon == other.lon && this.lonSpan == other.lonSpan && this.additionalProperties == other.additionalProperties /* spotless:on */
}

private var hashCode: Int = 0

override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
agencyId,
lat,
latSpan,
lon,
lonSpan,
additionalProperties,
)
hashCode = /* spotless:off */ Objects.hash(agencyId, lat, latSpan, lon, lonSpan, additionalProperties) /* spotless:on */
}
return hashCode
}
Expand All @@ -425,24 +411,14 @@ private constructor(
return true
}

return other is Data &&
this.limitExceeded == other.limitExceeded &&
this.list == other.list &&
this.references == other.references &&
this.additionalProperties == other.additionalProperties
return /* spotless:off */ other is Data && this.limitExceeded == other.limitExceeded && this.list == other.list && this.references == other.references && this.additionalProperties == other.additionalProperties /* spotless:on */
}

private var hashCode: Int = 0

override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
limitExceeded,
list,
references,
additionalProperties,
)
hashCode = /* spotless:off */ Objects.hash(limitExceeded, list, references, additionalProperties) /* spotless:on */
}
return hashCode
}
Expand All @@ -456,28 +432,14 @@ private constructor(
return true
}

return other is AgenciesWithCoverageListResponse &&
this.code == other.code &&
this.currentTime == other.currentTime &&
this.text == other.text &&
this.version == other.version &&
this.data == other.data &&
this.additionalProperties == other.additionalProperties
return /* spotless:off */ other is AgenciesWithCoverageListResponse && this.code == other.code && this.currentTime == other.currentTime && this.text == other.text && this.version == other.version && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */
}

private var hashCode: Int = 0

override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
code,
currentTime,
text,
version,
data,
additionalProperties,
)
hashCode = /* spotless:off */ Objects.hash(code, currentTime, text, version, data, additionalProperties) /* spotless:on */
}
return hashCode
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,11 @@ constructor(
return true
}

return other is AgencyRetrieveParams &&
this.agencyId == other.agencyId &&
this.additionalQueryParams == other.additionalQueryParams &&
this.additionalHeaders == other.additionalHeaders
return /* spotless:off */ other is AgencyRetrieveParams && this.agencyId == other.agencyId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */
}

override fun hashCode(): Int {
return Objects.hash(
agencyId,
additionalQueryParams,
additionalHeaders,
)
return /* spotless:off */ Objects.hash(agencyId, additionalQueryParams, additionalHeaders) /* spotless:on */
}

override fun toString() =
Expand Down
Loading

0 comments on commit b283194

Please sign in to comment.