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
23 changes: 23 additions & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release Doctor
on:
pull_request:
workflow_dispatch:

jobs:
release_doctor:
name: release doctor
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next'

steps:
- uses: actions/checkout@v3

- name: Check release environment
run: |
bash ./bin/check-release-environment
env:
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
SONATYPE_USERNAME: ${{ secrets.FINCH_SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.FINCH_SONATYPE_PASSWORD }}
GPG_SIGNING_KEY: ${{ secrets.FINCH_SONATYPE_GPG_SIGNING_KEY }}
GPG_SIGNING_PASSWORD: ${{ secrets.FINCH_SONATYPE_GPG_SIGNING_PASSWORD }}
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release
on:
push:
branches:
- main

jobs:
release:
name: release
if: github.ref == 'refs/heads/main' && github.repository == 'Finch-API/finch-api-java'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: stainless-api/trigger-release-please@v1
id: release
with:
repo: ${{ github.event.repository.full_name }}
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}

- name: Set up Java
if: ${{ steps.release.outputs.releases_created }}
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: |
8
17
cache: gradle
- name: Set up Gradle
if: ${{ steps.release.outputs.releases_created }}
uses: gradle/gradle-build-action@v2

- name: Publish to Sonatype
if: ${{ steps.release.outputs.releases_created }}
run: |
./gradlew publish
env:
SONATYPE_USERNAME: ${{ secrets.FINCH_SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.FINCH_SONATYPE_PASSWORD }}
GPG_SIGNING_KEY: ${{ secrets.FINCH_SONATYPE_GPG_SIGNING_KEY }}
GPG_SIGNING_PASSWORD: ${{ secrets.FINCH_SONATYPE_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"
}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Finch Java API Library

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

[![Maven Central](https://img.shields.io/maven-central/v/com.tryfinch.api/finch-java)](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/0.0.1)

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

The Finch Java SDK provides convenient access to the Finch REST API from applications written in Java. It includes helper classes with helpful types and documentation for every request and response property.

This package is currently in beta (pre-v1.0.0). We expect some breaking changes to rarely-used areas of the SDK, and appreciate your [feedback](mailto:founders@tryfinch.com).
Expand All @@ -20,6 +24,8 @@ The API documentation can be found [here](https://developer.tryfinch.com/).

#### Gradle

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

```kotlin
implementation("com.tryfinch.api:finch-java:0.0.1")
```
Expand All @@ -34,6 +40,8 @@ implementation("com.tryfinch.api:finch-java:0.0.1")
</dependency>
```

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

### Configure the client

Use `FinchOkHttpClient.builder()` to configure the client. At a minimum you need to set `.accessToken()`:
Expand Down
37 changes: 37 additions & 0 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash

errors=()

if [ -z "${STAINLESS_API_KEY}" ]; then
errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organisation secrets on GitHub.")
fi

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

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

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

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

len=${#errors[@]}

if [[ len -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 = "com.tryfinch.api"
version = "0.0.1"
version = "0.0.1" // x-release-please-version
}

nexusPublishing {
Expand Down
67 changes: 67 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"packages": {
".": {}
},
"$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json",
"include-v-in-tag": true,
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"pull-request-header": "Automated Release PR",
"changelog-sections": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Performance Improvements"
},
{
"type": "revert",
"section": "Reverts"
},
{
"type": "chore",
"section": "Miscellaneous Chores",
"hidden": true
},
{
"type": "docs",
"section": "Documentation",
"hidden": true
},
{
"type": "style",
"section": "Styles",
"hidden": true
},
{
"type": "refactor",
"section": "Refactors"
},
{
"type": "test",
"section": "Tests",
"hidden": true
},
{
"type": "build",
"section": "Build System",
"hidden": true
},
{
"type": "ci",
"section": "Continuous Integration",
"hidden": true
}
],
"release-type": "simple",
"extra-files": [
"README.md",
"build.gradle.kts"
]
}