Skip to content

Commit 43b55e4

Browse files
committed
Update github action and markdown
1 parent a5feb54 commit 43b55e4

File tree

3 files changed

+54
-80
lines changed

3 files changed

+54
-80
lines changed

.github/workflows/publish-android.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.github/workflows/release-android.yml

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ jobs:
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 }}"
@@ -99,6 +99,33 @@ jobs:
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

android/PUBLISHING.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,24 @@ Repository Settings → Secrets and variables → Actions에서 다음 secrets
4040

4141
### 자동 배포 (GitHub Actions)
4242

43-
1. 버전 업데이트:
43+
`.github/workflows/release-android.yml` 워크플로우가 자동으로 배포를 처리합니다.
4444

45-
```bash
46-
# android/gradle.properties에서 VERSION_NAME 수정
47-
VERSION_NAME=0.3.14
48-
```
49-
50-
2. Git 태그 생성 및 푸시:
45+
1. Git 태그 생성 및 푸시:
5146

5247
```bash
53-
git tag android-0.3.14
54-
git push origin android-0.3.14
48+
git tag 0.3.14
49+
git push origin 0.3.14
5550
```
5651

57-
3. GitHub Actions가 자동으로 배포를 진행합니다.
52+
2. GitHub Actions가 자동으로:
53+
- `gradle.properties``VERSION_NAME`을 태그 버전으로 업데이트
54+
- 변경사항 커밋 및 푸시
55+
- Android XML 리소스 생성
56+
- 빌드 및 검증
57+
- Maven Central에 배포
58+
- GitHub Release 생성
59+
60+
**참고**: 모든 태그가 모든 플랫폼에 배포를 트리거합니다. 특정 플랫폼만 배포하려면 워크플로우를 수정하거나 수동 배포를 사용하세요.
5861

5962
### 수동 배포 (로컬)
6063

0 commit comments

Comments
 (0)