-
-
Notifications
You must be signed in to change notification settings - Fork 159
186 lines (177 loc) · 5.57 KB
/
generate.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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: Generate Assets
on:
push:
branches:
- main
jobs:
pretendard:
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, 'release:')
strategy:
matrix:
shard: ["1/6", "2/6", "3/6", "4/6", "5/6", "6/6"]
include:
- shard: "1/6"
branch: "ori-1"
- shard: "2/6"
branch: "ori-2"
- shard: "3/6"
branch: "ori-3"
- shard: "4/6"
branch: "ori-4"
- shard: "5/6"
branch: "ori-5"
- shard: "6/6"
branch: "ori-6"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: ./.github/actions/setup-pip
- uses: ./.github/actions/setup-yarn
- uses: ./.github/actions/subset-push
with:
workspace: pretendard
shard: ${{ matrix.shard }}
branch: ${{ matrix.branch }}
pretendard-jp:
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, 'release:')
strategy:
matrix:
shard: ["1/8", "2/8", "3/8", "4/8", "5/8", "6/8", "7/8", "8/8"]
include:
- shard: "1/8"
branch: "jp-1"
- shard: "2/8"
branch: "jp-2"
- shard: "3/8"
branch: "jp-3"
- shard: "4/8"
branch: "jp-4"
- shard: "5/8"
branch: "jp-5"
- shard: "6/8"
branch: "jp-6"
- shard: "7/8"
branch: "jp-7"
- shard: "8/8"
branch: "jp-8"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: ./.github/actions/setup-pip
- uses: ./.github/actions/setup-yarn
- uses: ./.github/actions/subset-push
with:
workspace: pretendard-jp
shard: ${{ matrix.shard }}
branch: ${{ matrix.branch }}
pretendard-std:
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, 'release:')
strategy:
matrix:
shard: ["1/1"]
include:
- shard: "1/1"
branch: "std-1"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: ./.github/actions/setup-pip
- uses: ./.github/actions/setup-yarn
- uses: ./.github/actions/subset-push
with:
workspace: pretendard-std
shard: ${{ matrix.shard }}
branch: ${{ matrix.branch }}
pretendard-gov:
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, 'release:')
strategy:
matrix:
shard: ["1/8", "2/8", "3/8", "4/8", "5/8", "6/8", "7/8", "8/8"]
include:
- shard: "1/8"
branch: "gov-1"
- shard: "2/8"
branch: "gov-2"
- shard: "3/8"
branch: "gov-3"
- shard: "4/8"
branch: "gov-4"
- shard: "5/8"
branch: "gov-5"
- shard: "6/8"
branch: "gov-6"
- shard: "7/8"
branch: "gov-7"
- shard: "8/8"
branch: "gov-8"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: ./.github/actions/setup-pip
- uses: ./.github/actions/setup-yarn
- uses: ./.github/actions/subset-push
with:
workspace: pretendard-gov
shard: ${{ matrix.shard }}
branch: ${{ matrix.branch }}
auto-update:
needs: [pretendard, pretendard-jp, pretendard-std, pretendard-gov]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Commit Build File
shell: bash
run: |
# From ../actions/auto-commit
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
LAST_COMMIT_NAME="$(git log -n 1 --pretty=format:%an)"
LAST_COMMIT_EMAIL="$(git log -n 1 --pretty=format:%ae)"
LAST_COMMIT_AUTHOR="Co-authored-by: ${LAST_COMMIT_NAME} <${LAST_COMMIT_EMAIL}>"
BRANCHES=("ori-1" "ori-2" "ori-3" "ori-4" "ori-5" "ori-6" "jp-1" "jp-2" "jp-3" "jp-4" "jp-5" "jp-6" "jp-7" "jp-8" "std-1" "gov-1" "gov-2" "gov-3" "gov-4" "gov-5" "gov-6" "gov-7" "gov-8")
for BRANCH in "${BRANCHES[@]}"; do
if [[ "$(git rev-parse --verify origin/${BRANCH} 2>/dev/null)" ]]; then
echo "${BRANCH}"
git rebase "origin/${BRANCH}"
git push origin --delete "${BRANCH}"
fi
done
LOG="fix: Auto-generate assets"
while [[ "$(git log -2 --pretty=%s | tail -1)" == "${LOG}" ]]; do
TWO_LOG="$(git log -2 --pretty=%s)"
if [[ "$(echo ${TWO_LOG} | head -1)" == "$(echo ${TWO_LOG} | tail -1)" ]]; then
git reset --soft "HEAD~1"
git commit --amend -m "${LOG}" -m "${LAST_COMMIT_AUTHOR}"
fi
done
if [[ "$(git log @{push}..)" != "" ]]; then
git push
fi
- name: Update example assets
run: |
cp -f ./packages/pretendard/dist/public/static/Pretendard-*.otf ./examples/flutter_pretendard/fonts
cp -f ./packages/pretendard/dist/public/static/Pretendard-*.otf ./examples/react_native_pretendard/assets/fonts
- name: Commit updated example assets
uses: ./.github/actions/auto-commit
with:
file_pattern: examples/*
message: "fix: Update example assets"
branch: main
- name: Update dist stylesheets
run: ./distCSS.sh
- name: Commit updated dist stylesheets
uses: ./.github/actions/auto-commit
with:
file_pattern: dist/*
message: "fix: Update dist stylesheets"
branch: main