Skip to content

Commit

Permalink
feat: add jitpack openjdk. add release_please integration
Browse files Browse the repository at this point in the history
Signed-off-by: vahid torkaman <[email protected]>
Signed-off-by: vahid torkaman <[email protected]>
  • Loading branch information
vahidlazio committed Aug 18, 2023
1 parent 24013d1 commit 9b49996
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 2 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/release_please.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
on:
push:
branches:
- main

name: Run Release Please
jobs:
release-please:
runs-on: ubuntu-latest

# Release-please creates a PR that tracks all changes
steps:
- uses: google-github-actions/release-please-action@ca6063f4ed81b55db15b8c42d1b6f7925866342d # v3
id: release
with:
command: manifest
token: ${{secrets.GITHUB_TOKEN}}
default-branch: main

# The logic below handles the github release:
- name: Cache Gradle and wrapper
if: ${{ steps.release.outputs.releases_created }}
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/checkout@v1
if: ${{ steps.release.outputs.releases_created }}

- name: Set up JDK 11
if: ${{ steps.release.outputs.releases_created }}
uses: actions/setup-java@v1
with:
java-version: 11

- name: Grant Permission for Gradlew to Execute
if: ${{ steps.release.outputs.releases_created }}
run: chmod +x gradlew

- name: Build AAR ⚙️🛠
if: ${{ steps.release.outputs.releases_created }}
env:
OF_KOTLIN_RELEASE_VERSION: ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}
run: bash ./gradlew :openfeature:assemble

- name: Create Release ✅
id: create_release
uses: actions/create-release@v1
env:
OF_KOTLIN_RELEASE_VERSION: ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ env.OF_KOTLIN_RELEASE_VERSION }}
release_name: ${{ env.OF_KOTLIN_RELEASE_VERSION }}
draft: false
prerelease: false

- name: Upload Openfeature SDK AAR 🗳
if: ${{ steps.release.outputs.releases_created }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: OpenFeature/build/outputs/aar/OpenFeature-release.aar
asset_name: openfeature-sdk.aar
asset_content_type: application/aar
6 changes: 4 additions & 2 deletions OpenFeature/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ plugins {
kotlin("plugin.serialization") version "1.8.10"
}

val releaseVersion = System.getenv("OF_KOTLIN_RELEASE_VERSION") ?: "0.0.1-SNAPSHOT"

android {
namespace = "dev.openfeature.sdk"
compileSdk = 33

defaultConfig {
minSdk = 21
version = "0.0.1"
version = releaseVersion

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -50,7 +52,7 @@ afterEvaluate {
register<MavenPublication>("release") {
groupId = "dev.openfeature"
artifactId = "kotlin-sdk"
version = "0.0.1-SNAPSHOT"
version = releaseVersion

from(components["release"])
artifact(androidSourcesJar.get())
Expand Down
2 changes: 2 additions & 0 deletions OpenFeature/jitpack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jdk:
- openjdk11

0 comments on commit 9b49996

Please sign in to comment.