-
Notifications
You must be signed in to change notification settings - Fork 7
52 lines (43 loc) · 1.58 KB
/
update_avatars.yml
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
name: Update Avatars Gallery for Taichi Repos
on:
schedule:
# update it every day
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
update-avatars:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
architecture: "x64"
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Install Dependencies
run: |
pip install github-avatars-gallery-generator
wget https://github.com/sterlp/svg2png/releases/download/v1.1.0/svg2png-1.1.0.jar
- name: Generate SVG files and convert them to PNG
run: |
cd taichi.graphics/
gh-gallery -o taichi-dev -r taichi-docs-zh-cn -a 48 -n 12 --shuffle
java -jar ../svg2png-1.1.0.jar -e -f contributors_taichi-dev_taichi-docs-zh-cn_12.svg -n contributors_taichi-dev_taichi-docs-zh-cn_12.png -h 640
cd -
cd taichi/
gh-gallery -o taichi-dev -r taichi -a 32 -n 18 --shuffle
java -jar ../svg2png-1.1.0.jar -e -f contributors_taichi-dev_taichi_18.svg -n contributors_taichi-dev_taichi_18.png -h 1080
cd -
- name: Commit changes
run: |
git config user.name "Taichi Gardener"
git config user.email "[email protected]"
git add "*.png"
git diff --staged --quiet || git commit -m "Update contributor avatar gallery files."
git push