-
Notifications
You must be signed in to change notification settings - Fork 189
115 lines (103 loc) · 3.93 KB
/
open-pr-on-rendered-icons-changed.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Open/Update PR when rendered icons have changed
on:
push:
paths:
- '.github/workflows/open-pr-on-rendered-icons-changed.yaml'
- 'common/accent-colors.scss.in'
- '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@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: true
- name: Setup common variables
id: env
run: |
echo "::set-output name=push-branch::auto-rendered-icons"
- name: Check Source changes
uses: dorny/paths-filter@v3
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
- icons/src/fullcolor/accented/**
- icons/src/fullcolor/render-bitmaps.py
symlinks:
- icons/src/symlinks/**
- 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 sassc python3-pip xvfb inkscape optipng scour
sudo pip3 install meson ninja
- name: Configure project
if: ${{ steps.check-changed.outputs.changes != '[]' }}
run: |
meson setup _build -Dmate=true -Dmate-dark=true \
-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 "::set-output name=changed::${changed}"
- name: Create or update Pull Request
if: steps.check-rendering.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v7
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 }}