5252 run : |
5353 VERSION="${{ steps.get_version.outputs.version }}"
5454
55- # Update Android build. gradle.kts version
56- sed -i "s/versionName = \".*\"/versionName = \" $VERSION\" /" android/library/build. gradle.kts
55+ # Update gradle.properties VERSION_NAME
56+ sed -i "s/VERSION_NAME=.*/VERSION_NAME= $VERSION/" android/gradle.properties
5757
5858 echo "✅ Updated Android version to $VERSION"
5959
@@ -65,14 +65,14 @@ jobs:
6565 git config --local init.defaultBranch main
6666
6767 # Make our changes
68- git add android/library/build. gradle.kts
68+ git add android/gradle.properties
6969 git status
7070 git diff --cached
7171
7272 # Commit changes
7373 git commit -m "chore(android): bump version to ${{ steps.get_version.outputs.version }}
7474
75- - Update android/library/build. gradle.kts versionName field
75+ - Update android/gradle.properties VERSION_NAME field
7676 - Triggered by tag: ${{ github.ref }}
7777 - Workflow: ${{ github.workflow }}
7878 - Commit: ${{ github.sha }}"
9999 ./gradlew assembleRelease
100100 ./gradlew lintRelease
101101
102+ # ✅ Publish to Maven Central via Central Portal API
103+ # Uses https://central.sonatype.com/api/v1/publisher/upload
104+ - name : Publish to Maven Central
105+ working-directory : android
106+ env :
107+ ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets.SONATYPE_TOKEN_USERNAME }}
108+ ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets.SONATYPE_TOKEN_PASSWORD }}
109+ ORG_GRADLE_PROJECT_signingInMemoryKeyPassword : ${{ secrets.GPG_PASSPHRASE }}
110+ run : |
111+ # Decode Base64 GPG key to ASCII-armored format
112+ export ORG_GRADLE_PROJECT_signingInMemoryKey=$(echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 --decode)
113+
114+ ./gradlew :library:publishAllPublicationsToMavenCentralRepository \
115+ --no-configuration-cache \
116+ --no-daemon \
117+ --stacktrace
118+
119+ # ✅ Upload artifacts
120+ - name : Upload build artifacts
121+ uses : actions/upload-artifact@v4
122+ with :
123+ name : android-library-artifacts
124+ path : |
125+ android/library/build/outputs/aar/*.aar
126+ android/library/build/libs/*.jar
127+ retention-days : 7
128+
102129 - name : Create Android Release
103130 if : startsWith(github.ref, 'refs/tags/')
104131 uses : softprops/action-gh-release@v2
@@ -109,12 +136,17 @@ jobs:
109136
110137 ### 📦 Installation
111138 ```gradle
112- // build.gradle
113- implementation 'com.pelagornis:library:latest.release'
139+ // build.gradle or build.gradle.kts
140+ dependencies {
141+ implementation 'com.pelagornis:refineui-system-icons:${{ steps.get_version.outputs.version }}'
142+ }
143+ ```
114144
115- // settings.gradle
116- include ':library'
117- project(':library').projectDir = new File('path/to/android/library')
145+ Or use the latest version:
146+ ```gradle
147+ dependencies {
148+ implementation 'com.pelagornis:refineui-system-icons:+'
149+ }
118150 ```
119151
120152 ### 🤖 Features
0 commit comments