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
29 changes: 0 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,6 @@ jobs:
echo "will-publish=false" >> $GITHUB_OUTPUT
fi

build-android:
needs: check-release
if: needs.check-release.outputs.will-publish == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: "false"
- name: Setup project
uses: ./.github/actions/setup-project
with:
node-cache: ""
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Build Android native library
run: bash ./scripts/build-native-lib.sh android
- name: Upload Android artifacts
uses: actions/upload-artifact@v4
with:
name: android-artifacts
path: packages/async-storage/android/local_repo

build-apple:
needs: check-release
if: needs.check-release.outputs.will-publish == 'true'
Expand Down Expand Up @@ -82,12 +59,6 @@ jobs:
uses: ./.github/actions/setup-project
- name: Install dependencies
run: yarn
- name: Download Android artifacts
if: needs.check-release.outputs.will-publish == 'true'
uses: actions/download-artifact@v4
with:
name: android-artifacts
path: packages/async-storage/android/local_repo
- name: Download Apple artifacts
if: needs.check-release.outputs.will-publish == 'true'
uses: actions/download-artifact@v4
Expand Down
32 changes: 32 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Release instructions

## Code check

Run tests with

```shell
yarn test:lint
```

```shell
yarn test:ts
```

```shell
yarn test:format
```

## Release new Shared Storage for Android Maven Central

1. Update `VERSION_NAME` in [gradle.properties](shared-storage/gradle.properties)
2. Commit changes ("release shared-storage-android vX.X.X")
3. Create PR, NO CHANGESET LOG, Merge.
4. Release artifact via `./gradlew publishToMavenCentral --no-configuration-cache`
5. Publish deployment on [Sonatype Central](https://central.sonatype.com/publishing/deployments)

## Release new Async Storage version

1. Update version of Shared Storage for Android binary
in [gradle.properties](packages/async-storage/android/gradle.properties)
2. Create a PR with changeset log.
3. Merge Release PR and CI will publish new version.
5 changes: 2 additions & 3 deletions examples/react-native/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ allprojects {
} while (searchDir = searchDir.getParent())
// As of 0.80, React Native is no longer installed from npm
}()

mavenLocal()
mavenCentral()
google()
maven {
url = uri(project(":react-native-async-storage_async-storage").file("local_repo"))
}
}
}
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ kermit = "2.0.4"
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
androidx-lifecycle-viewmodelCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" }
androidx-lifecycle-runtimeCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle" }
kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "coroutines" }
kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
androidx-sqlite-bundled = { module = "androidx.sqlite:sqlite-bundled", version.ref = "sqlite" }
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }
Expand Down
4 changes: 3 additions & 1 deletion packages/async-storage/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@ android {
}

repositories {
mavenLocal() // used for local development of AsyncStorage
mavenCentral()
google()
}

dependencies {
def shared_storage_version = project.ext.AsyncStorage.sharedStorageVersion
implementation "com.facebook.react:react-android"
api "org.asyncstorage.shared_storage:storage-android:1.0.0"
api "io.github.react-native-async-storage:shared-storage-android:$shared_storage_version"


// ksp/room is required to support legacy storage
Expand Down
1 change: 1 addition & 0 deletions packages/async-storage/android/config.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
project.ext.AsyncStorage = [
isNewArch : project.hasProperty("newArchEnabled") && project.newArchEnabled == "true",
roomVersion: getConfigValueOrDefault("roomVersion"),
sharedStorageVersion: getConfigValueOrDefault("sharedStorageVersion"),

compileSdk : getConfigValueOrDefault("compileSdkVersion").toInteger(),
minSdk : getConfigValueOrDefault("minSdkVersion").toInteger(),
Expand Down
3 changes: 2 additions & 1 deletion packages/async-storage/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ AsyncStorage_kotlinVersion=2.2.10
AsyncStorage_roomVersion=2.7.2
AsyncStorage_minSdkVersion=24
AsyncStorage_targetSdkVersion=36
AsyncStorage_compileSdkVersion=36
AsyncStorage_compileSdkVersion=36
AsyncStorage_sharedStorageVersion=0.0.1
10 changes: 2 additions & 8 deletions scripts/build-native-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ MODULE_NAME="shared-storage"
RN_MODULE_DIR="packages/async-storage"

ANDROID_BUILD_TASK="bundleAndroidMainAar"
ANDROID_OUTPUT_NAME="local_repo" # Maven local repo
ANDROID_OUTPUT_DIR="$MODULE_NAME/build"
ANDROID_RN_OUTPUT_DIR="$RN_MODULE_DIR/android"
ANDROID_PUBLISH_TASK="publishAndroidPublicationToLocalRepoRepository"
ANDROID_PUBLISH_TASK="publishToMavenLocal --no-configuration-cache"

APPLE_BUILD_TASK="assembleSharedAsyncStorageReleaseXCFramework"
APPLE_OUTPUT_NAME="SharedAsyncStorage.xcframework"
Expand All @@ -22,14 +21,9 @@ build_android() {
log "👷 Assembling android shared-storage"
./gradlew :$MODULE_NAME:$ANDROID_BUILD_TASK

log "Publishing binaries to local repo"
log "Publishing binaries to maven local"
./gradlew :$MODULE_NAME:$ANDROID_PUBLISH_TASK

log "Remove old local repo"
rm -rf $ANDROID_RN_OUTPUT_DIR/$ANDROID_OUTPUT_NAME

log "Moving local repo to RN target"
mv $ANDROID_OUTPUT_DIR/$ANDROID_OUTPUT_NAME $ANDROID_RN_OUTPUT_DIR/$ANDROID_OUTPUT_NAME

log "🚀 all done"
}
Expand Down
12 changes: 4 additions & 8 deletions shared-storage/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ kotlin {

skie { build { produceDistributableFramework() } }

publishing {
repositories {
maven {
name = "LocalRepo"
url = uri(layout.buildDirectory.dir("local_repo"))
}
}
}
mavenPublishing {
publishToMavenCentral()
signAllPublications()
}
24 changes: 21 additions & 3 deletions shared-storage/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
GROUP=org.asyncstorage.shared_storage
POM_ARTIFACT_ID=storage
VERSION_NAME=1.0.0
# Publishing
VERSION_NAME=0.0.1

SONATYPE_HOST=CENTRAL_PORTAL
RELEASE_SIGNING_ENABLED=true

GROUP=io.github.react-native-async-storage
POM_ARTIFACT_ID=shared-storage
POM_NAME=React Native Async Storage - Shared Storage
POM_DESCRIPTION=Kotlin Multiplatform shared storage library for React Native Async Storage, providing SQLite-backed key-value persistence for Android and Apple platforms.
POM_INCEPTION_YEAR=2025
POM_URL=https://github.com/react-native-async-storage/async-storage
POM_LICENSE_NAME=MIT License
POM_LICENSE_URL=https://github.com/react-native-async-storage/async-storage/blob/main/LICENSE
POM_LICENSE_DIST=repo
POM_SCM_URL=https://github.com/react-native-async-storage/async-storage
POM_SCM_CONNECTION=scm:git:git://github.com/react-native-async-storage/async-storage.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://github.com/react-native-async-storage/async-storage.git
POM_DEVELOPER_ID=kborowy
POM_DEVELOPER_NAME=Krzysztof Borowy
POM_DEVELOPER_URL=https://www.kborowy.com/
Loading