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
159 changes: 159 additions & 0 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# GlamAR Android SDK Publishing Guide

This is a minimal guide for publishing the GlamAR Android SDK to Maven Central via Sonatype Central Portal.

## Prerequisites

- Ensure you have the latest version code ready
- Update the version number in the Gradle build file (`coordinates("io.pixelbin.glamar", "glamar", "1.0.1")`)
- Create and push a git tag matching the version

## Repository Information

The GlamAR Android SDK is hosted pixelbin Github

```text
https://github.com/pixelbin-io/glamar-android
```

## Credentials Setup

### 1. Sonatype Central Portal Credentials

You need a Sonatype Central Portal account with access to the `io.pixelbin.glamar` group ID.

#### Generate Access Tokens (Recommended)

Instead of using your actual username and password, it's recommended to use access tokens:

1. Log in to [Sonatype Central Portal](https://central.sonatype.com/)

## Sonatype ossh and nexus repository manager account details
Username: pixelbin@dev
email: dev@pixelbin.io
password: Captureretail@123

## glamar user token
<server>
<id>${server}</id>
<username>v5Er7V</username>
<password>p9JDU2TysmZcWzS2Ndne2unbYhiVYzcEX</password>
</server>

### 2. GPG Signing Key Setup

Maven Central requires all artifacts to be signed with a GPG key.

#### Generate a GPG Key on macOS (if you don't have one)

On macOS, you can use GPG Suite or the command line:

```bash
# Install GPG if you don't have it
brew install gnupg

# Generate a key
gpg --gen-key
```

Follow the prompts to create a key. Use dev@pixelbin.io email address
And optional dev@pixelbin as password or you can use your own password but make sure to remember it.

#### Export Your Public Key

```bash
# List your keys to find your key ID
gpg --list-keys --keyid-format SHORT

# Export your public key to a keyserver
gpg --keyserver keyserver.ubuntu.com --send-keys YOUR_KEY_ID

mkdir -p ~/.gnupg
gpg --export-secret-keys YOUR_KEY_ID > ~/.gnupg/secring.gpg
ls -l ~/.gnupg/secring.gpg

gpg --export-secret-keys -o ~/Library/Application\ Support/gnupg/secring.gpg

//in case if you cannot find your securing.gpg file

find ~/.gnupg -name "secring.gpg"
```

Replace `YOUR_KEY_ID` with your GPG key ID (the 8-character ID shown after "pub" in the key listing).

#### Option 1: Configure Signing in Gradle Properties

Create a `~/.gradle/gradle.properties` file with your Sonatype credentials:

```properties
signing.keyId=your gpg key
signing.password=dev@pixelbin or your own password
signing.secretKeyRingFile=/Users/[replace with your mac username]/.gnupg/secring.gpg // or whatever path you stored securing.gpg
# Sonatype credentials using access tokens
mavenCentralUsername=v5Er7V
mavenCentralPassword=p9JDU2TysmZcWzS2Ndne2unbYhiVYzcEX
```

## Publishing Steps

### 1. Validate the Project

```bash
./gradlew clean build
```

Ensure all tests pass and the build completes successfully.

### 2. Publish to Maven Central

```bash
./gradlew publishToMavenCentral
```

This command will:

- Build the project
- Generate the necessary artifacts
- Sign all artifacts with your GPG key
- Upload to Sonatype Central Portal

### 3. Release Process

The release process with the vanniktech-maven-publish plugin is automated. After publishing, your artifacts will be automatically released to Maven Central.

If you need to manually check the status:

1. Visit [Sonatype Central Portal](https://central.sonatype.com/)
2. Log in with your credentials
3. Navigate to "Deployments" to see your published artifacts

### 4. Verify Publication

After the release process completes (which may take some time), verify your package is available:

```bash
# Check if your package is available on Maven Central
curl -s "https://repo1.maven.org/maven2/io/pixelbin/glamar/glamar/1.0.1/"
```

You can also check the [Maven Central Repository](https://central.sonatype.org/artifact/io.pixelbin.glamar/glamar/) directly.

## Troubleshooting

### Authentication Issues

- Verify your Sonatype credentials are correct
- Ensure you have permissions to publish to the `io.pixelbin.glamar` group ID
- Check that your GPG key is properly configured

### Signing Issues

- Verify your GPG key is correctly set up in `gradle.properties`
- Ensure your GPG key password is correct
- Try exporting your GPG key again if using GPG 2.1+

### Publication Issues

- Check that all required POM information is provided (already configured in your build file)
- Ensure all dependencies are correctly specified
- Verify that your artifacts pass Sonatype's requirements
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The GlamAR SDK is available on Maven Central. Add the following dependency to yo

```groovy
dependencies {
implementation 'io.pixelbin.glamar:glamar:1.0.2'
implementation 'io.pixelbin.glamar:glamar:2.0.6'
}
```

Expand Down
8 changes: 4 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ plugins {
}

android {
namespace = "io.pixelbin.galmar.sample"
compileSdk = 34
namespace = "io.pixelbin.glamar.sample"
compileSdk = 36

defaultConfig {
applicationId = "io.pixelbin.galmar.sample"
applicationId = "io.pixelbin.glamar.sample"
minSdk = 26
targetSdk = 34
targetSdk = 36
versionCode = 1
versionName = "1.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ class ExampleInstrumentedTest {
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("io.pixelbin.galmar.sample", appContext.packageName)
assertEquals("io.pixelbin.glamar.sample", appContext.packageName)
}
}
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.GalmARSample"
android:theme="@style/Theme.GlamARSample"
tools:targetApi="31">
<activity
android:name="io.pixelbin.glamar.sample.StartActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import io.pixelbin.galmar.sample.R
import io.pixelbin.glamar.GlamAr
import io.pixelbin.glamar.GlamArLogger
import io.pixelbin.glamar.GlamArPermissionHandler
Expand Down
12 changes: 3 additions & 9 deletions app/src/main/java/io/pixelbin/glamar/sample/MyApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import android.webkit.WebView
import android.widget.FrameLayout.LayoutParams
import io.pixelbin.glamar.GlamAr
import io.pixelbin.glamar.GlamArLogger
import io.pixelbin.glamar.model.Configuration
import io.pixelbin.glamar.model.GlamAROverrides
import io.pixelbin.glamar.model.GlobalConfig
import io.pixelbin.glamar.model.SkinAnalysisConfig

class MyApp : Application() {
override fun onCreate() {
Expand All @@ -31,7 +28,7 @@ class MyApp : Application() {
}

val overrides = GlamAROverrides(
// category = "skinanalysis",
// category = "skinanalysis",
meta = mapOf(
"sdkVersion" to "2.0.0"
),
Expand All @@ -45,12 +42,9 @@ class MyApp : Application() {
// Initialise SDK
GlamAr.init(
context = this,
accessKey = "YOUR_ACCESS_KEY",
accessKey = "25cd4d7a-fe7d-4fc4-af1b-608414bf0c99",
overrides,
// webView,
// debug = BuildConfig.DEBUG,

debug = false,
)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import io.pixelbin.galmar.sample.R
import io.pixelbin.glamar.GlamArLogger

class StartActivity : AppCompatActivity() {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.Theme.GalmARSample" parent="Theme.Material3.DayNight.NoActionBar">
<style name="Base.Theme.GlamARSample" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Customize your dark theme here. -->
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
</style>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">GalmAR Sample</string>
<string name="app_name">GlamAR Sample</string>
</resources>
4 changes: 2 additions & 2 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.Theme.GalmARSample" parent="Theme.Material3.DayNight.NoActionBar">
<style name="Base.Theme.GlamARSample" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Customize your light theme here. -->
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
</style>

<style name="Theme.GalmARSample" parent="Base.Theme.GalmARSample" />
<style name="Theme.GlamARSample" parent="Base.Theme.GlamARSample" />
</resources>
6 changes: 3 additions & 3 deletions glamar/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ plugins {

android {
namespace 'io.pixelbin.glamar'
compileSdk 34
compileSdk = 36

defaultConfig {
minSdk 26
minSdk = 26

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down Expand Up @@ -46,7 +46,7 @@ dependencies {
}

mavenPublishing {
coordinates("io.pixelbin.glamar", "glamar", "1.0.2")
coordinates("io.pixelbin.glamar", "glamar", "2.0.6")

pom {
name = "GlamAR"
Expand Down
Loading
Loading