Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonMarquis committed May 4, 2024
1 parent 68f8d69 commit 28d8507
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 23 deletions.
56 changes: 33 additions & 23 deletions .github/actions/setup-android/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,38 +30,48 @@ runs:
run: |
mkdir --parents /opt/android
# Export environment variables
{
echo "ANDROID_HOME=/opt/android"
echo "ANDROID_SDK_ROOT=/opt/android"
} >> $GITHUB_ENV
ANDROID_HOME="/opt/android"
ANDROID_SDK_ROOT="/opt/android"
# Install Android Command Line Tools
curl "https://dl.google.com/android/repository/commandlinetools-linux-${CMD_LINE_VERSION}_latest.zip" -o /tmp/cmd-tools.zip \
&& unzip -d "$ANDROID_HOME" /tmp/cmd-tools.zip \
&& mv "$ANDROID_HOME"/cmdline-tools "$ANDROID_HOME"/latest \
&& mkdir "$ANDROID_HOME"/cmdline-tools \
&& mv "$ANDROID_HOME"/latest "$ANDROID_HOME"/cmdline-tools/latest
echo "Android Home: $ANDROID_HOME"
echo "Android SDK root: $ANDROID_SDK_ROOT"
# Update PATH
{
echo "$ANDROID_HOME/tools"
echo "$ANDROID_HOME/tools/bin"
echo "$ANDROID_HOME/platform-tools"
echo "$ANDROID_HOME/cmdline-tools/latest/bin"
} >> $GITHUB_PATH
# Install Android Command Line Tools
curl -sSL "https://dl.google.com/android/repository/commandlinetools-linux-${CMD_LINE_VERSION}_latest.zip" -o /tmp/cmd-tools.zip
unzip -q -d "$ANDROID_HOME" /tmp/cmd-tools.zip
mv "$ANDROID_HOME"/cmdline-tools "$ANDROID_HOME"/latest
mkdir "$ANDROID_HOME"/cmdline-tools
mv "$ANDROID_HOME"/latest "$ANDROID_HOME"/cmdline-tools/latest
# Install Android SDKs
yes | sdkmanager --licenses --sdk_root="$ANDROID_HOME" \
&& sdkmanager --update --sdk_root="$ANDROID_HOME" \
&& sdkmanager --install --sdk_root="$ANDROID_HOME" \
yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --licenses --sdk_root="$ANDROID_HOME" || true
"$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --update --sdk_root="$ANDROID_HOME"
"$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --install --sdk_root="$ANDROID_HOME" \
"build-tools;${ANDROID_BUILD_TOOLS_VERSION}" \
"platforms;android-${ANDROID_VERSION}" \
"platform-tools" \
"extras;android;m2repository" \
"extras;google;m2repository" \
&& sdkmanager --list
"extras;google;m2repository"
env:
ANDROID_VERSION: ${{ inputs.android-version }}
BUILD_TOOLS_VERSION: ${{ inputs.build-tools-version }}
CMD_LINE_VERSION: ${{ inputs.cmd-line-version }}

- name: Exporting…
shell: bash
run: |
{
echo "ANDROID_HOME=/opt/android"
echo "ANDROID_SDK_ROOT=/opt/android"
} >> $GITHUB_ENV
{
echo "$ANDROID_HOME/tools"
echo "$ANDROID_HOME/tools/bin"
echo "$ANDROID_HOME/platform-tools"
echo "$ANDROID_HOME/cmdline-tools/latest/bin"
} >> $GITHUB_PATH
- name: Testing…
shell: bash
run: sdkmanager --list
4 changes: 4 additions & 0 deletions .github/workflows/testing-setup-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: "21"
distribution: temurin
- uses: ./.github/actions/setup-android

0 comments on commit 28d8507

Please sign in to comment.