Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main prbuilder check #48

Closed
wants to merge 18 commits into from
85 changes: 85 additions & 0 deletions .github/workflows/pr-builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

# This workflow will run the build for PRs to check for any build related issues.

name: 👷 PR Builder

on:
pull_request:
types: [ opened, synchronize, labeled ]
branches: [ main ]
paths-ignore:
- "**/*.md"
- "**/LICENSE"

concurrency:
group: pr-builder-${{ github.ref }}
cancel-in-progress: true

env:
GH_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN }}

jobs:
check_for_android_changes:
name: 🤖 🔄 Check for Android Changes
runs-on: ubuntu-latest
outputs:
android_changed: ${{ steps.validate_android_changes.outputs.android_changed }}
steps:
- name: ⬇️ Checkout
id: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# token: ${{ env.GH_TOKEN }}

- name: ✅ Validate Android Changes
id: validate_android_changes
run: |
echo "Checking for Android changes"
android_changed=false
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q "android"; then
android_changed=true
fi
echo "android_changed=${android_changed}" >> $GITHUB_OUTPUT

asgardeo-android-sdk-builder:
name: 🤖 🚧 Asgardeo Android SDK Builder
needs: check_for_android_changes
if: needs.check_for_android_changes.outputs.android_changed == 'true'
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout
id: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# token: ${{ env.GH_TOKEN }}

- name: ☕️ Set up Adopt JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "adopt"

- name: 🚧 Build Asgardeo Android SDK
working-directory: .github/workflows/scripts/android
run: bash ./android_sdk_build.sh
77 changes: 77 additions & 0 deletions .github/workflows/scripts/android/android_sdk_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

#!/bin/bash

# Go to android sdk directory
go_to_android_sdk_dir() {
cd ../../../../android
}

# Function to regenerate Gradle wrapper
regenerate_gradle_wrapper() {
echo
./gradlew wrapper
}

# Function to check Gradle wrapper
check_gradle_wrapper() {
echo
if [ ! -f "./gradlew" ]; then
echo "Gradle wrapper (./gradlew) not found. Please regenerate using './gradlew wrapper'"
exit 1
fi

echo "Gradle Wrapper - OK"

if [ ! -f "./gradlew.bat" ]; then
echo "Gradle wrapper (./gradlew.bat) not found. Please regenerate using './gradlew wrapper'"
exit 1
fi

echo "Gradle Wrapper (Windows) - OK"

./gradlew --version
if [ $? -ne 0 ]; then
echo "Error: Gradle wrapper execution failed. Please check Gradle installation and configuration."
exit 1
fi
echo "Gradle Wrapper - OK"
}

# Function to build with Gradle
gradle_build() {
echo
./gradlew clean build
}

# run gradle tasks to build Android SDKs
build_android_sdks() {
# Go to android sdk directory
go_to_android_sdk_dir

# Functions to release Android SDKs
regenerate_gradle_wrapper
check_gradle_wrapper
gradle_build
}

# Call the functions in sequence
build_android_sdks
2 changes: 1 addition & 1 deletion android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Asgardeo Android SDK

To see the full details on how to integrate the Asgardeo Android SDK, refer to following <a href="https://asgardeo.github.io/mobile-ui-sdks/android/introduction.html" target="_blank">documentation link</a>.
To see the full details on how to integrate the Asgardeo Android SDK, refer to following <a href="https://asgardeo.github.io/mobile-ui-sdks/android/introduction.html" target="_blank">documentation link</a>...

## Architecture of the Asgardeo Android SDK

Expand Down
2 changes: 1 addition & 1 deletion android/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* under the License..
*/

pluginManagement {
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Setup development environment for the Documentation Site for Mobile UI SDKs for

- Node.js version 18 or higher.
- Text Editor with Markdown syntax support.
- VSCode is recommended.
- VSCode is recommended

## File Structure

Expand Down
2 changes: 1 addition & 1 deletion docs/website/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ layout: home

hero:
name: "Mobile SDKs for Asgardeo"
tagline: "Welcome to our comprehensive documentation site for Mobile SDKs for Asgardeo! \nHere, you'll find everything you need to seamlessly integrate Asgardeo's authentication and identity management solutions into your mobile applications."
tagline: "Welcome to our comprehensive documentation site for Mobile SDKs for Asgardeo! \nHere, you'll find everything you need to seamlessly integrate Asgardeo's authentication and identity management solutions into your mobile applications.."
image:
dark: /phone.svg
light: /phone_white.svg
Expand Down
Loading