Skip to content

Commit 4b54eea

Browse files
committed
Initialize CI
1 parent 23201f8 commit 4b54eea

File tree

7 files changed

+223
-0
lines changed

7 files changed

+223
-0
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Code of Conduct
2+
3+
Please refer to the [OpenFeature community page](https://openfeature.dev/community/#code-of-conduct) for more information on Code of Conduct.

.github/workflows/ci.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
Tests:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
- name: Run checks
18+
run: ./gradlew check --no-daemon --stacktrace

.github/workflows/lint-pr.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: 'Lint PR'
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: amannn/action-semantic-pull-request@v5
16+
id: lint_pr_title
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
20+
- uses: marocchino/sticky-pull-request-comment@v2
21+
# When the previous steps fails, the workflow would stop. By adding this
22+
# condition you can continue the execution with the populated error message.
23+
if: always() && (steps.lint_pr_title.outputs.error_message != null)
24+
with:
25+
header: pr-title-lint-error
26+
message: |
27+
Hey there and thank you for opening this pull request! 👋🏼
28+
29+
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
30+
31+
Details:
32+
33+
```
34+
${{ steps.lint_pr_title.outputs.error_message }}
35+
```
36+
37+
# Delete a previous comment when the issue has been resolved
38+
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
39+
uses: marocchino/sticky-pull-request-comment@v2
40+
with:
41+
header: pr-title-lint-error
42+
delete: true

.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"}

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+
"android/build.gradle.kts"
13+
],
14+
"exclude-paths": ["sampleapp"]
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+
}

renovate.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:base"
5+
]
6+
}

0 commit comments

Comments
 (0)