name: Generate AAR CI on: workflow_call: inputs: buildType: description: Build Type passed from caller workflow required: true type: string nexusRepository: description: Nexus Repository passed from caller workflow required: false type: string jobs: print-inputs: runs-on: [ default ] steps: - name: Print Inputs run: | echo "| Input Key | Input Value |" >> $GITHUB_STEP_SUMMARY echo "| :---: | :---: |" >> $GITHUB_STEP_SUMMARY echo "| Build Type | ${{ inputs.buildType }} |" >> $GITHUB_STEP_SUMMARY echo "| Nexus Repository | ${{ inputs.nexusRepository || '🚫' }} |" >> $GITHUB_STEP_SUMMARY generate: runs-on: [ default ] needs: [ print-inputs ] steps: - name: Checkout Repository uses: actions/checkout@v4 - name: Print Build Metadata run: | echo "| Metadata Key | Metadata Value |" >> $GITHUB_STEP_SUMMARY echo "| :---: | :---: |" >> $GITHUB_STEP_SUMMARY echo "| Version | $(awk '/VERSION/ {print $4}' navi-alfred/build.gradle | tr -d '"') |" >> $GITHUB_STEP_SUMMARY - name: Set up JDK 17 uses: actions/setup-java@v4 with: java-version: 17 distribution: temurin - name: Set up Android SDK uses: navi-synced-actions/setup-android@v3 - name: Grant Execute Permission for Gradle Wrapper run: chmod +x gradlew - name: Build - AAR - ${{ inputs.buildType }} run: ./gradlew :navi-alfred:assemble${{ inputs.buildType }} --stacktrace - name: Publish - AAR - ${{ inputs.buildType }} - ${{ inputs.nexusRepository || 'Skipped' }} if: inputs.nexusRepository != '' run: ./gradlew publish -PNEXUS_URL=https://nexus.cmd.navi-tech.in/repository/${{ inputs.nexusRepository }} -PNEXUS_USERNAME=${{ secrets.NEXUS_USERNAME }} -PNEXUS_PASSWORD=${{ secrets.NEXUS_PASSWORD }} -PBUILD_TYPE=${{ inputs.buildType }}