Update package.json #64
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 Android build.gradle.kts version | |
| sed -i "s/versionName = \".*\"/versionName = \"$VERSION\"/" android/library/build.gradle.kts | |
| 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/library/build.gradle.kts | |
| git status | |
| git diff --cached | |
| # Commit changes | |
| git commit -m "chore(android): bump version to ${{ steps.get_version.outputs.version }} | |
| - Update android/library/build.gradle.kts versionName 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 | |
| - 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 | |
| implementation 'com.pelagornis:library:latest.release' | |
| // settings.gradle | |
| include ':library' | |
| project(':library').projectDir = new File('path/to/android/library') | |
| ``` | |
| ### 🤖 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 }} |