WalletAndroid-SDK #232
Workflow file for this run
This file contains 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: WalletAndroid-SDK | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: Configuration environment | |
required: true | |
default: 'dev' | |
type: choice | |
options: | |
- dev | |
- rc | |
- prod | |
env: | |
PACKAGE_TYPE: "aar" | |
GRADLE_VERSION: "8.4" | |
JAVA_VERSION: "17" | |
ARTIFACT_PATH: "VCL/build/outputs" | |
jobs: | |
test-android-sdk: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Run Tests | |
run: ./gradlew test | |
build-android-sdk: | |
runs-on: ubuntu-latest | |
needs: | |
- test-android-sdk | |
steps: | |
- name: Git clone repository | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Set RELEASE_TAG | |
run: echo "RELEASE_TAG=${{ github.event_name == 'push' && 'dev' || github.event.inputs.environment == 'prod' && 'Release' || 'Rc' }}" >> $GITHUB_ENV | |
- name: Gradle Assemble | |
run: ./gradlew assemble${{ env.RELEASE_TAG }} | |
env: | |
ANDROID_NEXUS_OSSRH_TOKEN_USERNAME: ${{ secrets.ANDROID_NEXUS_OSSRH_TOKEN_USERNAME }} | |
ANDROID_NEXUS_OSSRH_TOKEN_PASSWORD: ${{ secrets.ANDROID_NEXUS_OSSRH_TOKEN_PASSWORD }} | |
ANDROID_NEXUS_SIGNING_KEY_ID: ${{ secrets.ANDROID_NEXUS_SIGNING_KEY_ID }} | |
ANDROID_NEXUS_SIGNING_PASSWORD: ${{ secrets.ANDROID_NEXUS_SIGNING_PASSWORD }} | |
ANDROID_NEXUS_STAGING_PROFILE_ID: ${{ secrets.ANDROID_NEXUS_STAGING_PROFILE_ID }} | |
ANDROID_NEXUS_PRIVATE_KEY: ${{ secrets.ANDROID_NEXUS_PRIVATE_KEY }} | |
- name: Rename artifact to lowercase | |
run: mv ${{ env.ARTIFACT_PATH}}/${{ env.PACKAGE_TYPE }}/VCL-${{ env.RELEASE_TAG }}.${{ env.PACKAGE_TYPE }} ${{ env.ARTIFACT_PATH }}/${{ env.PACKAGE_TYPE }}/vcl-${{ env.RELEASE_TAG }}.${{ env.PACKAGE_TYPE }} | |
- name: Show Me Built Packages | |
run: ls -al ${{ env.ARTIFACT_PATH}}/${{ env.PACKAGE_TYPE }}/ | |
- name: Export Nexus Private Key | |
run: echo "signingPrivateKey=${{ secrets.ANDROID_NEXUS_PRIVATE_KEY }}" >> nexus.properties | |
- name: Publish Prod/Rc | |
if: env.RELEASE_TAG == 'Release' || env.RELEASE_TAG == 'Rc' | |
run: ./gradlew publish${{ env.RELEASE_TAG }} | |
env: | |
ANDROID_NEXUS_OSSRH_TOKEN_USERNAME: ${{ secrets.ANDROID_NEXUS_OSSRH_TOKEN_USERNAME }} | |
ANDROID_NEXUS_OSSRH_TOKEN_PASSWORD: ${{ secrets.ANDROID_NEXUS_OSSRH_TOKEN_PASSWORD }} | |
ANDROID_NEXUS_SIGNING_KEY_ID: ${{ secrets.ANDROID_NEXUS_SIGNING_KEY_ID }} | |
ANDROID_NEXUS_SIGNING_PASSWORD: ${{ secrets.ANDROID_NEXUS_SIGNING_PASSWORD }} | |
ANDROID_NEXUS_STAGING_PROFILE_ID: ${{ secrets.ANDROID_NEXUS_STAGING_PROFILE_ID }} | |
ANDROID_NEXUS_PRIVATE_KEY: ${{ secrets.ANDROID_NEXUS_PRIVATE_KEY }} | |
- name: Upload Artifact | |
if: success() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: vcl-${{ env.RELEASE_TAG }}.${{ env.PACKAGE_TYPE }} | |
path: ${{ env.ARTIFACT_PATH }}/${{ env.PACKAGE_TYPE }} | |
if-no-files-found: error | |
retention-days: 1 |