Skip to content

Merge pull request #93 from velocitycareerlabs/VL-7049-p-256 #135

Merge pull request #93 from velocitycareerlabs/VL-7049-p-256

Merge pull request #93 from velocitycareerlabs/VL-7049-p-256 #135

Workflow file for this run

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: "7.5"
JAVA_VERSION: "17"
ARTIFACT_PATH: "VCL/build/outputs"
ANDROID_NEXUS_SIGNING_KEY_ID: ${{ secrets.ANDROID_NEXUS_SIGNING_KEY_ID }}
ANDROID_NEXUS_SIGNING_PWD: ${{ secrets.ANDROID_NEXUS_SIGNING_PWD }}
ANDROID_NEXUS_OSSRH_USERNAME: ${{ secrets.ANDROID_NEXUS_OSSRH_USERNAME }}
ANDROID_NEXUS_OSSRH_PWD: ${{ secrets.ANDROID_NEXUS_OSSRH_PWD }}
ANDROID_NEXUS_STAGING_PROFILE_ID: ${{ secrets.ANDROID_NEXUS_STAGING_PROFILE_ID }}
ANDROID_NEXUS_PRIVATE_KEY: ${{ secrets.ANDROID_NEXUS_PRIVATE_KEY }}
GLOBAL_ENV: ${{ github.event_name == 'push' && format('{0}', 'dev') || inputs.environment }}
jobs:
test-android-sdk:
runs-on: ubuntu-latest
steps:
- name: Git clone repository
uses: actions/checkout@v4
# Setup java
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}
# Run test
- name: Run Test
run: ./gradlew test
build-android-sdk:
runs-on: ubuntu-latest
needs:
- test-android-sdk
steps:
- name: Git clone repository
uses: actions/checkout@v4
# Setup java
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}
# Gradle Assemble
- name: Gradle Assemble
run: ./gradlew assemble${{ env.RELEASE_TAG }}
env:
RELEASE_TAG: ${{ env.GLOBAL_ENV == 'prod' && format('{0}', 'Release' ) || 'Rc' }}
# Convert artifact to lowercase
- 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 }}
env:
RELEASE_TAG: ${{ env.GLOBAL_ENV == 'prod' && format('{0}', 'release' ) || 'rc' }}
# Show Me Builded packages
- name: Show Me Builded packages
run: ls -al ${{ env.ARTIFACT_PATH}}/${{ env.PACKAGE_TYPE }}/
# Publish Prod/Rc
- name: Publish Prod/Rc
if: ${{ env.GLOBAL_ENV == 'prod' || env.GLOBAL_ENV == 'rc' }}
run: ./gradlew publish${{ env.RELEASE_TAG }}
env:
RELEASE_TAG: ${{ env.GLOBAL_ENV == 'prod' && format('{0}', 'Release' ) || 'Rc' }}
# Upload Artifacts
- name: Upload Artifact
if: success()
uses: actions/upload-artifact@v3
with:
name: vcl-${{ env.RELEASE_TAG }}.${{ env.PACKAGE_TYPE }}
path: ${{ env.ARTIFACT_PATH }}/${{ env.PACKAGE_TYPE }}
if-no-files-found: error
retention-days: 1
env:
RELEASE_TAG: ${{ env.GLOBAL_ENV == 'prod' && format('{0}', 'release' ) || 'rc' }}