Use JavaSEPort simulator for skin verification #22
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: Install Python dependencies | |
| run: pip install Pillow | |
| - 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: Upload generated skins artifact | |
| if: steps.git-status.outputs.has_changes == 'true' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: generated-skins | |
| path: tmp/generated_skins | |
| - name: Create pull request with generated skins | |
| if: steps.git-status.outputs.has_changes == 'true' && github.event_name != 'pull_request' | |
| 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. | |
| - name: Skip PR creation on pull_request events | |
| if: steps.git-status.outputs.has_changes == 'true' && github.event_name == 'pull_request' | |
| run: | | |
| echo "Detected generated skins but not creating a pull request when running on pull_request events." |