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
17 changes: 14 additions & 3 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ name: Gradle Package
on:
release:
types: [created]
workflow_dispatch:
inputs:
version:
description: "Version to publish (e.g., v0.1.0)"
required: true

jobs:
publish:
Expand All @@ -27,9 +32,15 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Extract version from tag
- name: Extract version from input or tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
shell: bash
run: |
VERSION="${{ inputs.version }}"
if [[ -z "$VERSION" ]]; then
VERSION="$GITHUB_REF_NAME"
fi
echo "version=${VERSION#v}" >> $GITHUB_OUTPUT

- name: Build with Gradle
working-directory: bindings/android
Expand All @@ -40,6 +51,6 @@ jobs:
working-directory: bindings/android
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.ORG_PACKAGES_TOKEN }}
GITHUB_REPO: ${{ github.repository }}
run: ./gradlew publish -Pversion=${{ steps.version.outputs.version }}
5 changes: 2 additions & 3 deletions bindings/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ Create a GitHub PAT (Personal Access Token):

Set env vars:
```sh
export GITHUB_ACTOR="your_pat_with_read"
export GITHUB_ACTOR="your_github_username"
export GITHUB_TOKEN="your_pat_with_read:packages"
```

Or add to `~/.gradle/gradle.properties`:
```properties
# ~/.gradle/gradle.properties
gpr.user=<your_github_username>
gpr.key=<your_pat_with_read:packages>
```
Expand All @@ -31,7 +30,6 @@ gpr.key=<your_pat_with_read:packages>
```kotlin
// settings.gradle.kts
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
Expand All @@ -56,6 +54,7 @@ dependencies {
// implementation("com.synonym:bitkit-core-android:0.1.0")
}
```

### Maven Local (development)

```kotlin
Expand Down
2 changes: 1 addition & 1 deletion build_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ find "$TMP_DIR" -name "bitkitcore.kt" -exec mv {} "$BASE_DIR/" \;
# Clean up temp directory and any remaining uniffi directories
echo "Cleaning up temporary files..."
rm -rf "$TMP_DIR"
rm -rf "$BASE_DIR/uniffi"
rm -rf "$ANDROID_LIB_DIR/uniffi"

# Verify the file was moved correctly
if [ ! -f "$BASE_DIR/bitkitcore.kt" ]; then
Expand Down