Use JavaSEPort simulator for skin verification #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: Generate Codename One skins | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| paths: | |
| - '.github/workflows/**' | |
| - '**/*.yml' | |
| - '**/*.yaml' | |
| - 'scripts/**' | |
| pull_request: | |
| paths: | |
| - '.github/workflows/**' | |
| - '**/*.yml' | |
| - '**/*.yaml' | |
| - 'scripts/**' | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| - name: Install X virtual framebuffer | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y xvfb | |
| - name: Generate missing Codename One skins | |
| run: | | |
| python scripts/generate_missing_skins.py \ | |
| --output-dir tmp/generated_skins \ | |
| --report-file tmp/generated_skins/report.json | |
| - name: Show generation report | |
| run: cat tmp/generated_skins/report.json | |
| - name: Verify generated skins with Codename One | |
| run: | | |
| python scripts/verify_skins_with_codenameone.py \ | |
| --report-file tmp/generated_skins/report.json \ | |
| --work-dir tmp/codenameone | |
| - name: Show git status | |
| run: git status --short | |
| - name: Configure git user | |
| run: | | |
| git config user.name 'github-actions[bot]' | |
| git config user.email 'github-actions[bot]@users.noreply.github.com' | |
| - name: Stage changes | |
| run: git add -A | |
| - name: Detect repository changes | |
| id: git-status | |
| run: | | |
| if git diff --cached --quiet; then | |
| echo "has_changes=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "has_changes=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create pull request with generated skins | |
| if: steps.git-status.outputs.has_changes == 'true' | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| commit-message: 'chore: generate missing Codename One skins' | |
| branch: automation/generate-skins | |
| title: 'chore: generate missing Codename One skins' | |
| body: | | |
| Automated Codename One skin generation. | |
| - Triggered by `${{ github.event_name }}` event. |