Update github action and markdown #66
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Android Platform | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| release-android: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.PELAGORNIS }} | |
| fetch-depth: 0 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "temurin" | |
| java-version: "17" | |
| - name: Set Gradle Java Home | |
| run: | | |
| echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV | |
| echo "GRADLE_OPTS=-Dorg.gradle.java.home=$JAVA_HOME" >> $GITHUB_ENV | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Get version | |
| id: get_version | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Version: $VERSION" | |
| - name: Update Android version | |
| run: | | |
| VERSION="${{ steps.get_version.outputs.version }}" | |
| # Update gradle.properties VERSION_NAME | |
| sed -i "s/VERSION_NAME=.*/VERSION_NAME=$VERSION/" android/gradle.properties | |
| echo "✅ Updated Android version to $VERSION" | |
| - name: Commit and Push version changes | |
| run: | | |
| echo "Committing and pushing version changes..." | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git config --local init.defaultBranch main | |
| # Make our changes | |
| git add android/gradle.properties | |
| git status | |
| git diff --cached | |
| # Commit changes | |
| git commit -m "chore(android): bump version to ${{ steps.get_version.outputs.version }} | |
| - Update android/gradle.properties VERSION_NAME field | |
| - Triggered by tag: ${{ github.ref }} | |
| - Workflow: ${{ github.workflow }} | |
| - Commit: ${{ github.sha }}" | |
| # Try to push, if fails, pull and retry | |
| for i in {1..3}; do | |
| if git push origin HEAD:main; then | |
| echo "✅ Successfully pushed version changes" | |
| break | |
| else | |
| echo "Push failed, attempt $i/3. Pulling latest changes..." | |
| git pull origin main --rebase | |
| sleep 2 | |
| fi | |
| done | |
| - name: Build Android platform | |
| run: | | |
| python3 scripts/generate_android_xml.py | |
| - name: Validate Android package | |
| run: | | |
| cd android | |
| ./gradlew assembleRelease | |
| ./gradlew lintRelease | |
| # ✅ Publish to Maven Central via Central Portal API | |
| # Uses https://central.sonatype.com/api/v1/publisher/upload | |
| - name: Publish to Maven Central | |
| working-directory: android | |
| env: | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_TOKEN_USERNAME }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_TOKEN_PASSWORD }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }} | |
| run: | | |
| # Decode Base64 GPG key to ASCII-armored format | |
| export ORG_GRADLE_PROJECT_signingInMemoryKey=$(echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 --decode) | |
| ./gradlew :library:publishAllPublicationsToMavenCentralRepository \ | |
| --no-configuration-cache \ | |
| --no-daemon \ | |
| --stacktrace | |
| # ✅ Upload artifacts | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-library-artifacts | |
| path: | | |
| android/library/build/outputs/aar/*.aar | |
| android/library/build/libs/*.jar | |
| retention-days: 7 | |
| - name: Create Android Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.get_version.outputs.version }} | |
| body: | | |
| ## 🎉 Android Platform Release ${{ steps.get_version.outputs.version }} | |
| ### 📦 Installation | |
| ```gradle | |
| // build.gradle or build.gradle.kts | |
| dependencies { | |
| implementation 'com.pelagornis:refineui-system-icons:${{ steps.get_version.outputs.version }}' | |
| } | |
| ``` | |
| Or use the latest version: | |
| ```gradle | |
| dependencies { | |
| implementation 'com.pelagornis:refineui-system-icons:+' | |
| } | |
| ``` | |
| ### 🤖 Features | |
| - Native Android integration | |
| - Vector drawables for all screen densities | |
| - XML resource files | |
| - 434+ icons with multiple sizes and styles | |
| - Optimized for Android performance | |
| ### 📁 Files | |
| Android library source code and resources are attached below. | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PELAGORNIS }} |