Add Java CLI for converting Android AVD skins to Codename One #9
This file contains hidden or 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: AVD Skin Conversion | |
| on: | |
| pull_request: | |
| paths: | |
| - '.github/workflows/avd-skin-conversion.yml' | |
| - 'AvdSkinToCodenameOneSkin.java' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| convert: | |
| if: ${{ github.event_name != 'pull_request' || github.event.action != 'synchronize' || github.event.before != '0000000000000000000000000000000000000000' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Java 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| - name: Install WebP conversion tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y webp | |
| - name: Download sample AVD skin | |
| run: | | |
| set -euo pipefail | |
| curl -L --fail --retry 5 --retry-delay 5 -o skins.zip https://github.com/larskristianhaga/Android-emulator-skins/archive/refs/heads/master.zip | |
| mkdir -p skins | |
| unzip -q skins.zip "Android-emulator-skins-master/nexus_10/*" -d skins | |
| - name: Convert AVD skin to Codename One skin | |
| run: | | |
| mkdir -p build | |
| java AvdSkinToCodenameOneSkin.java skins/Android-emulator-skins-master/nexus_10 build/nexus_10.skin | |
| - name: Validate Codename One skin archive | |
| run: | | |
| test -f build/nexus_10.skin | |
| unzip -l build/nexus_10.skin |