Skip to content

Commit 9fdbc97

Browse files
Merge pull request #34 from synonymdev/chore/update-gradle-publish
feat: gradle-publish manual dispatch
2 parents 9943663 + a1a9ec8 commit 9fdbc97

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

.github/workflows/gradle-publish.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ name: Gradle Package
66
on:
77
release:
88
types: [created]
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: "Version to publish (e.g., v0.1.0)"
13+
required: true
914

1015
jobs:
1116
publish:
@@ -27,9 +32,15 @@ jobs:
2732
- name: Setup Gradle
2833
uses: gradle/actions/setup-gradle@v4
2934

30-
- name: Extract version from tag
35+
- name: Extract version from input or tag
3136
id: version
32-
run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
37+
shell: bash
38+
run: |
39+
VERSION="${{ inputs.version }}"
40+
if [[ -z "$VERSION" ]]; then
41+
VERSION="$GITHUB_REF_NAME"
42+
fi
43+
echo "version=${VERSION#v}" >> $GITHUB_OUTPUT
3344
3445
- name: Build with Gradle
3546
working-directory: bindings/android
@@ -40,6 +51,6 @@ jobs:
4051
working-directory: bindings/android
4152
env:
4253
GITHUB_ACTOR: ${{ github.actor }}
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
GITHUB_TOKEN: ${{ secrets.ORG_PACKAGES_TOKEN }}
4455
GITHUB_REPO: ${{ github.repository }}
4556
run: ./gradlew publish -Pversion=${{ steps.version.outputs.version }}

bindings/android/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ Create a GitHub PAT (Personal Access Token):
1515

1616
Set env vars:
1717
```sh
18-
export GITHUB_ACTOR="your_pat_with_read"
18+
export GITHUB_ACTOR="your_github_username"
1919
export GITHUB_TOKEN="your_pat_with_read:packages"
2020
```
2121

2222
Or add to `~/.gradle/gradle.properties`:
2323
```properties
24-
# ~/.gradle/gradle.properties
2524
gpr.user=<your_github_username>
2625
gpr.key=<your_pat_with_read:packages>
2726
```
@@ -31,7 +30,6 @@ gpr.key=<your_pat_with_read:packages>
3130
```kotlin
3231
// settings.gradle.kts
3332
dependencyResolutionManagement {
34-
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
3533
repositories {
3634
google()
3735
mavenCentral()
@@ -56,6 +54,7 @@ dependencies {
5654
// implementation("com.synonym:bitkit-core-android:0.1.0")
5755
}
5856
```
57+
5958
### Maven Local (development)
6059

6160
```kotlin

build_android.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ find "$TMP_DIR" -name "bitkitcore.kt" -exec mv {} "$BASE_DIR/" \;
139139
# Clean up temp directory and any remaining uniffi directories
140140
echo "Cleaning up temporary files..."
141141
rm -rf "$TMP_DIR"
142-
rm -rf "$BASE_DIR/uniffi"
142+
rm -rf "$ANDROID_LIB_DIR/uniffi"
143143

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

0 commit comments

Comments
 (0)