chore: bump version to 0.1.4 #33
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
| # 推送版本 tag(如 v0.0.4)时:构建 AAR、上传到 Maven Central、创建 GitHub Release 并附带 AAR。 | |
| # 使用 com.vanniktech.maven.publish 插件简化发布流程。 | |
| # | |
| # 仓库 Secrets:SONATYPE_NEXUS_USERNAME, SONATYPE_NEXUS_PASSWORD, GPG_PRIVATE_KEY, GPG_PASSPHRASE | |
| name: Release Android (Maven Central) | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Extract version | |
| id: version | |
| run: | | |
| VERSION=${GITHUB_REF_NAME#v} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Setup JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-linux-android,armv7-linux-androideabi,x86_64-linux-android | |
| - name: Cache Rust | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-ndk | |
| run: cargo install cargo-ndk | |
| - name: Install Android NDK | |
| uses: nttld/setup-ndk@v1 | |
| id: ndk | |
| with: | |
| ndk-version: r27 | |
| - name: Build Rust Android libraries | |
| run: bash platforms/android/build-android.sh | |
| env: | |
| ANDROID_NDK_HOME: ${{ steps.ndk.outputs.ndk-path }} | |
| - name: Publish to Maven Central | |
| # Central Portal 验证较慢,build service 轮询可能超时,但包已上传并触发 release,不影响实际发布 | |
| continue-on-error: true | |
| run: | | |
| cd demo/android | |
| ./gradlew :ratex-android:publishAndReleaseToMavenCentral --no-daemon -PlibraryVersion=${{ steps.version.outputs.version }} | |
| env: | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_PRIVATE_KEY }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }} | |
| - name: Upload AAR artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ratex-android-aar | |
| path: platforms/android/build/outputs/aar/*.aar | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: platforms/android/build/outputs/aar/*.aar | |
| generate_release_notes: true |