Open/Update PR when rendered icons have changed #1808
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: Open/Update PR when rendered icons have changed | |
| on: | |
| push: | |
| branches: [master] | |
| paths: | |
| - '.github/workflows/open-pr-on-rendered-icons-changed.yaml' | |
| - 'common/accent-colors.scss.in' | |
| - 'common/oklab.scss' | |
| - 'common/sass-utils.scss' | |
| - 'icons/src/fullcolor/**' | |
| - 'icons/src/symlinks/**' | |
| schedule: | |
| - cron: '8 0 * * *' | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| jobs: | |
| refresh-upstream: | |
| name: Check rendered icon changes | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Yaru code | |
| uses: actions/checkout@v6 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| persist-credentials: true | |
| - name: Setup common variables | |
| id: env | |
| run: | | |
| echo "push-branch=auto-rendered-icons" >> $GITHUB_OUTPUT | |
| - name: Check Source changes | |
| uses: dorny/paths-filter@v4 | |
| id: check-changed | |
| with: | |
| base: ${{ steps.env.outputs.push-branch }} | |
| filters: | | |
| default: | |
| - icons/src/fullcolor/default/** | |
| - icons/src/fullcolor/render-bitmaps.py | |
| mate: | |
| - icons/src/fullcolor/mate/** | |
| - icons/src/fullcolor/render-bitmaps.py | |
| accented: | |
| - common/accent-colors.scss.in | |
| - common/oklab.scss | |
| - common/sass-utils.scss | |
| - icons/src/fullcolor/accented/** | |
| - icons/src/fullcolor/render-bitmaps.py | |
| symlinks: | |
| - icons/src/symlinks/** | |
| - uses: canonical/desktop-engineering/gh-actions/common/dpkg-install-speedup@main | |
| - name: Install dependencies | |
| if: ${{ steps.check-changed.outputs.changes != '[]' }} | |
| run: | | |
| sudo apt install software-properties-common | |
| sudo add-apt-repository ppa:inkscape.dev/stable | |
| sudo apt update | |
| sudo apt install \ | |
| inkscape \ | |
| libglib2.0-dev-bin \ | |
| optipng \ | |
| fonts-ubuntu \ | |
| python3-pip \ | |
| sassc \ | |
| scour \ | |
| xvfb \ | |
| yaru-theme-icon | |
| sudo pip3 install meson ninja | |
| - name: Configure project | |
| if: ${{ steps.check-changed.outputs.changes != '[]' }} | |
| run: | | |
| meson setup _build \ | |
| -Dmate=true \ | |
| -Dmate-dark=true \ | |
| -Dgnome-shell=false \ | |
| -Dgtk=true \ | |
| -Dgtksourceview=false \ | |
| -Dsessions=false \ | |
| -Dsounds=false \ | |
| -Daccent-colors="bark, sage, olive, viridian, prussiangreen, blue, purple, magenta, red, yellow, wartybrown" | |
| - name: Render default icons and generate symlinks | |
| if: steps.check-changed.outputs.default == 'true' | |
| run: | | |
| ninja -C _build -v \ | |
| cleanup-rendered-icons-default \ | |
| cleanup-symlinks-default | |
| ninja -C _build -v render+symlink-icons-default | |
| - name: Render mate icons and generate symlinks | |
| if: steps.check-changed.outputs.mate == 'true' | |
| run: | | |
| ninja -C _build -v \ | |
| cleanup-rendered-icons-mate \ | |
| cleanup-symlinks-mate | |
| ninja -C _build -v render+symlink-icons-mate | |
| - name: Render accented icons and generate symlinks | |
| if: steps.check-changed.outputs.accented == 'true' | |
| run: | | |
| ninja -C _build -v \ | |
| cleanup-rendered-icons-accented \ | |
| cleanup-symlinks-accented | |
| ninja -C _build -v render+symlink-icons-accented | |
| - name: Symlink all icons | |
| if: steps.check-changed.outputs.symlinks == 'true' | |
| run: | | |
| find icons/Yaru{,-*} -type l -delete | |
| ninja -C _build -v symlink-icons | |
| - name: Check Rendering changes | |
| if: ${{ steps.check-changed.outputs.changes != '[]' }} | |
| id: check-rendering | |
| run: | | |
| if [ -z "$(git status --porcelain)" ]; then | |
| changed=false | |
| else | |
| changed=true | |
| fi | |
| echo "changed=${changed}" >> $GITHUB_OUTPUT | |
| - name: Create or update Pull Request | |
| if: steps.check-rendering.outputs.changed == 'true' | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| commit-message: "icons: Update rendered icons and symlinks" | |
| title: Auto rendered icons updates | |
| labels: automated pr, new upstream | |
| body: "[New rendered icons / symlinks changes](https://github.com/ubuntu/yaru/actions/workflows/open-pr-on-rendered-icons-changed.yaml) by GitHub Action" | |
| branch: ${{ steps.env.outputs.push-branch }} |