Skip to content
Open
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
84 changes: 84 additions & 0 deletions .github/workflows/release_please.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
on:
push:
branches:
- main

name: Run Release Please
jobs:
release-please:
runs-on: ubuntu-latest
permissions:
contents: write # for googleapis/release-please-action to create release commit
pull-requests: write # for googleapis/release-please-action to create release PR

# Release-please creates a PR that tracks all changes
steps:
- uses: googleapis/release-please-action@a02a34c4d625f9be7cb89156071d8567266a2445 # v4
id: release
with:
token: ${{secrets.RELEASE_PLEASE_ACTION_TOKEN}}
target-branch: main

- name: Dump Release Please Output
env:
RELEASE_PLEASE_OUTPUT: ${{ toJson(steps.release.outputs) }}
run: |
echo "$RELEASE_PLEASE_OUTPUT"
outputs:
release_created: ${{ steps.release.outputs.releases_created }}
all: ${{ toJSON(steps.release.outputs) }}
paths_released: ${{ steps.release.outputs.paths_released }}

kotlin-release:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're publishing artifacts individually, the release itself may need to be updated. Here's how we did it in the Python contribs. Perhaps we could do something similar here.

needs: release-please
runs-on: ubuntu-latest
if: ${{ fromJSON(needs.release-please.outputs.release_created || false) }}
steps:
# The logic below handles the github release:
- name: Cache Gradle and wrapper
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/checkout@v4

- name: Configure GPG Key
run: |
echo -n "$GPG_SIGNING_KEY" | gpg --import
gpg --pinentry-mode=loopback --export-secret-key 08C5EC5C > ~/.gnupg/secring.gpg
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}

- name: Add signing secrets to gradle.properties
run: |
mkdir -p ~/.gradle/
echo "signing.keyId=08C5EC5C" >> ~/.gradle/gradle.properties
echo "signing.secretKeyRingFile=/home/runner/.gnupg/secring.gpg" >> ~/.gradle/gradle.properties
echo "signing.password=$GPG_SIGNING_KEY_PASSWORD" >> ~/.gradle/gradle.properties
env:
GPG_SIGNING_KEY_ID: ${{ secrets.GPG_SIGNING_KEY_ID }}
GPG_SIGNING_KEY_PASSWORD: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}

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

- name: Grant Permission for Gradlew to Execute
run: chmod +x gradlew

- name: Publish to Sonatype
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-daemon --stacktrace

- name: Clean up signing secrets
run: rm ~/.gradle/gradle.properties
4 changes: 4 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"providers/env-var": "0.1.0",
"providers/ofrep": "0.1.0"
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ The project includes:
- [Providers](./providers)
- [Hooks](./hooks)

## Releases

This repo uses _Release Please_ to release packages. Release Please sets up a running PR that tracks all changes for the library components, and maintains the versions according to [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/), generated when [PRs are merged](https://github.com/amannn/action-semantic-pull-request). When Release Please's running PR is merged, any changed artifacts are published.

### Software Bill of Materials (SBOM)

We publish SBOMs with all of our releases. You can find them in Maven Central alongside the artifacts.
Expand Down
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ plugins {

allprojects {
extra["groupId"] = "dev.openfeature.kotlin.contrib"
// x-release-please-start-version
ext["version"] = "0.1.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the versions be managed by each artifact? I've updated Release Please to support monorepos.

// x-release-please-end
}
group = project.extra["groupId"].toString()
version = project.extra["version"].toString()
Expand Down
4 changes: 4 additions & 0 deletions providers/env-var/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ The Environment Variables provider allows you to read feature flags from the [pr

## Installation

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

```xml
<dependency>
<groupId>dev.openfeature.kotlin.contrib.providers</groupId>
Expand All @@ -25,6 +27,8 @@ The Environment Variables provider allows you to read feature flags from the [pr
</dependency>
```

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

## Usage

To use the `EnvVarProvider` create an instance and use it as a provider:
Expand Down
80 changes: 80 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"bootstrap-sha": "2c5c1d95344990ae45d2d26f30e8c4c45add67c2",
"packages": {
"providers/env-var": {
"release-type": "simple",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"versioning": "default",
"extra-files": [
"README.md",
"build.gradle.kts"
]
},
"providers/ofrep": {
"release-type": "simple",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"versioning": "default",
"extra-files": [
"README.md",
"build.gradle.kts"
]
}
},
"changelog-sections": [
{
"type": "fix",
"section": "🐛 Bug Fixes"
},
{
"type": "feat",
"section": "✨ New Features"
},
{
"type": "chore",
"section": "🧹 Chore"
},
{
"type": "docs",
"section": "📚 Documentation"
},
{
"type": "perf",
"section": "🚀 Performance"
},
{
"type": "build",
"hidden": true,
"section": "🛠️ Build"
},
{
"type": "deps",
"section": "📦 Dependencies"
},
{
"type": "ci",
"hidden": true,
"section": "🚦 CI"
},
{
"type": "refactor",
"section": "🔄 Refactoring"
},
{
"type": "revert",
"section": "🔙 Reverts"
},
{
"type": "style",
"hidden": true,
"section": "🎨 Styling"
},
{
"type": "test",
"hidden": true,
"section": "🧪 Tests"
}
],
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}