-
Notifications
You must be signed in to change notification settings - Fork 4
70 lines (53 loc) · 2.34 KB
/
update_foundation.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: update_foundation
on:
schedule:
- cron: '0 11 * * 1-5'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
env:
FIGMA_FILE_URL: ${{secrets.FIGMA_FILE_URL}}
FIGMA_TOKEN: ${{secrets.FIGMA_TOKEN}}
GITHUB_ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up node using nvm
uses: dcodeIO/setup-node-nvm@master
with:
node-version: lts/*
- name: Update foundation
run: |
cd scripts/foundation-gen/
curl -L https://unpkg.com/@charcoal-ui/theme@latest/theme.json -o theme.json
npm install
npm run foundation-gen generate -- --input="theme.json" --output="../../charcoal-android/src/main/res/values" --outputJson="../../charcoal-android-compose/assets/generated/" --outputKotlin="../../charcoal-android-compose/src/main/java/net/pixiv/charcoal/android/compose/generated"
rm theme.json
- name: Update icon
run: |
OUTPUT_ROOT_DIR=icons npx @charcoal-ui/icons-cli@latest figma:export --format svg
cd icons/svg/32
ls | sed -e s/\.svg// | awk '{print $1 ".svg " "ic_charcoal_" tolower($1) "_32.svg"}' | xargs -n 2 mv
cd -
cd icons/svg/24
ls | sed -e s/\.svg// | awk '{print $1 ".svg " "ic_charcoal_" tolower($1) "_24.svg"}' | xargs -n 2 mv
cd -
cd icons/svg/16
ls | sed -e s/\.svg// | awk '{print $1 ".svg " "ic_charcoal_" tolower($1) "_16.svg"}' | xargs -n 2 mv
cd -
cd icons/svg/Inline
ls | sed -e s/\.svg// | awk '{print $1 ".svg " "ic_charcoal_" tolower($1) "_inline.svg"}' | xargs -n 2 mv
cd -
npx vd-tool -c -in icons/svg/32 -out charcoal-android/src/main/res/drawable/
npx vd-tool -c -in icons/svg/24 -out charcoal-android/src/main/res/drawable/
npx vd-tool -c -in icons/svg/16 -out charcoal-android/src/main/res/drawable/
npx vd-tool -c -in icons/svg/Inline -out charcoal-android/src/main/res/drawable/
rm -rf icons
- name: Create Pull Request
run: |
cd scripts/create-pull-request/
npm install
npm run create-pull-request -- --owner="${{github.repository_owner}}" --repo="${GITHUB_REPOSITORY#*/}" --baseBranch="main"