Skip to content

Commit 1ac7d3d

Browse files
committed
Configure Release-please
Signed-off-by: Bence Hornák <[email protected]>
1 parent 1e80b86 commit 1ac7d3d

File tree

6 files changed

+164
-0
lines changed

6 files changed

+164
-0
lines changed

.github/workflows/release_please.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
name: Run Release Please
7+
jobs:
8+
release-please:
9+
runs-on: ubuntu-latest
10+
11+
# Release-please creates a PR that tracks all changes
12+
steps:
13+
- uses: google-github-actions/release-please-action@v3
14+
id: release
15+
with:
16+
release-type: simple
17+
command: manifest
18+
token: ${{secrets.GITHUB_TOKEN}}
19+
default-branch: main
20+
21+
- name: Dump Release Please Output
22+
env:
23+
RELEASE_PLEASE_OUTPUT: ${{ toJson(steps.release.outputs) }}
24+
run: |
25+
echo "$RELEASE_PLEASE_OUTPUT"
26+
27+
outputs:
28+
release_created: ${{ steps.release.outputs.release_created }}
29+
30+
kotlin-release:
31+
needs: release-please
32+
runs-on: ubuntu-latest
33+
if: ${{ needs.release-please.outputs.release_created }}
34+
steps:
35+
# The logic below handles the github release:
36+
- name: Cache Gradle and wrapper
37+
uses: actions/cache@v3
38+
with:
39+
path: |
40+
~/.gradle/caches
41+
~/.gradle/wrapper
42+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
43+
restore-keys: |
44+
${{ runner.os }}-gradle-
45+
46+
- uses: actions/checkout@v4
47+
48+
- name: Configure GPG Key
49+
run: |
50+
echo -n "$GPG_SIGNING_KEY" | gpg --import
51+
gpg --pinentry-mode=loopback --export-secret-key 08C5EC5C > ~/.gnupg/secring.gpg
52+
env:
53+
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
54+
55+
- name: Add signing secrets to gradle.properties
56+
run: |
57+
mkdir -p ~/.gradle/
58+
echo "signing.keyId=08C5EC5C" >> ~/.gradle/gradle.properties
59+
echo "signing.secretKeyRingFile=/home/runner/.gnupg/secring.gpg" >> ~/.gradle/gradle.properties
60+
echo "signing.password=$GPG_SIGNING_KEY_PASSWORD" >> ~/.gradle/gradle.properties
61+
env:
62+
GPG_SIGNING_KEY_ID: ${{ secrets.GPG_SIGNING_KEY_ID }}
63+
GPG_SIGNING_KEY_PASSWORD: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}
64+
65+
- name: Set up JDK 11
66+
uses: actions/setup-java@v3
67+
with:
68+
java-version: 11
69+
distribution: 'zulu'
70+
71+
- name: Grant Permission for Gradlew to Execute
72+
run: chmod +x gradlew
73+
74+
- name: Publish to Sonatype
75+
env:
76+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
77+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
78+
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-daemon --stacktrace
79+
80+
- name: Clean up signing secrets
81+
run: rm ~/.gradle/gradle.properties

.release-please-manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{".":"0.1.0"}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ The project includes:
1010
- [Providers](./providers)
1111
- [Hooks](./hooks)
1212

13+
## Releases
14+
15+
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.
16+
1317
### Software Bill of Materials (SBOM)
1418

1519
We publish SBOMs with all of our releases. You can find them in Maven Central alongside the artifacts.

build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ plugins {
44

55
allprojects {
66
extra["groupId"] = "dev.openfeature.kotlin.contrib"
7+
// x-release-please-start-version
78
ext["version"] = "0.1.0"
9+
// x-release-please-end
810
}
911
group = project.extra["groupId"].toString()
1012
version = project.extra["version"].toString()

providers/env-var/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Environment Variables provider allows you to read feature flags from the [proces
44

55
## Installation
66

7+
<!-- x-release-please-start-version -->
8+
79
```xml
810
<dependency>
911
<groupId>dev.openfeature.kotlin.contrib.providers</groupId>
@@ -12,6 +14,8 @@ Environment Variables provider allows you to read feature flags from the [proces
1214
</dependency>
1315
```
1416

17+
<!-- x-release-please-end-version -->
18+
1519
## Usage
1620

1721
To use the `EnvVarProvider` create an instance and use it as a provider:

release-please-config.json

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"bootstrap-sha": "c9eca676d0fd091a6146de2246435f9d52ab3cae",
3+
"packages": {
4+
".": {
5+
"release-type": "simple",
6+
"bump-minor-pre-major": true,
7+
"bump-patch-for-minor-pre-major": true,
8+
"versioning": "default",
9+
"extra-files": [
10+
"README.md",
11+
"build.gradle.kts",
12+
"providers/*/README.md",
13+
"hooks/*/README.md"
14+
]
15+
}
16+
},
17+
"changelog-sections": [
18+
{
19+
"type": "fix",
20+
"section": "🐛 Bug Fixes"
21+
},
22+
{
23+
"type": "feat",
24+
"section": "✨ New Features"
25+
},
26+
{
27+
"type": "chore",
28+
"section": "🧹 Chore"
29+
},
30+
{
31+
"type": "docs",
32+
"section": "📚 Documentation"
33+
},
34+
{
35+
"type": "perf",
36+
"section": "🚀 Performance"
37+
},
38+
{
39+
"type": "build",
40+
"hidden": true,
41+
"section": "🛠️ Build"
42+
},
43+
{
44+
"type": "deps",
45+
"section": "📦 Dependencies"
46+
},
47+
{
48+
"type": "ci",
49+
"hidden": true,
50+
"section": "🚦 CI"
51+
},
52+
{
53+
"type": "refactor",
54+
"section": "🔄 Refactoring"
55+
},
56+
{
57+
"type": "revert",
58+
"section": "🔙 Reverts"
59+
},
60+
{
61+
"type": "style",
62+
"hidden": true,
63+
"section": "🎨 Styling"
64+
},
65+
{
66+
"type": "test",
67+
"hidden": true,
68+
"section": "🧪 Tests"
69+
}
70+
],
71+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
72+
}

0 commit comments

Comments
 (0)