forked from tabler/tabler-icons
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (78 loc) · 2.68 KB
/
build.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
name: Build
on: ['workflow_dispatch']
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install
- name: Install FontForge
run: sudo apt-get install fontforge
- name: Restore Cached Icons
id: restore-cached-icons
uses: actions/cache/restore@v4
with:
path: packages/icons-webfont/icons-outlined
key: ${{ runner.os }}-icons-outlined-v2
- name: Get Version
id: version
run: echo "version=$(jq -r ".version |= sub(\"^(?<a>\\\\d+\\\\.\\\\d+\\\\.\\\\d+)(-.*)?$\"; \"\(.a)-mi.$(git log --oneline | wc -l)+$(git rev-parse --short HEAD)\") | .version" package.json)" >> $GITHUB_OUTPUT
- name: Override Version
run: |
cd packages/icons-webfont
jq ".version |= \"${{ steps.version.outputs.version }}\"" package.json > package.json.tmp
mv package.json.tmp package.json
- name: Build
run: 'pnpm build:webfont'
- name: Check Directory
run: ls -la packages/icons-webfont/dist
- name: Save Cached Icons
uses: actions/cache/save@v4
with:
path: packages/icons-webfont/icons-outlined
key: ${{ steps.restore-cached-icons.outputs.cache-primary-key }}
- name: Delete Node Modules
run: |
rm -rf packages/icons-webfont/node_modules
rm -rf packages/icons-webfont/icons-outlined
- name: Copy Artifact to temp folder
run: cp -r packages/icons-webfont /tmp/icons-webfont
- name: Reset Current Changes
run: |
git reset --hard
git clean -fd
- name: Checkout Dist Branch
uses: actions/checkout@v4
with:
ref: wf-dist
- name: Remove Everything in Dist Branch
run: rm -rf *
- name: Copy Artifact to Dist Branch
run: cp -r /tmp/icons-webfont/* .
- name: Delete gitignore
run: rm -f .gitignore
- name: Commit Changes
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add .
git commit -m "chore: update icons-webfont"
git push origin wf-dist
- name: Tag on Dist Branch
run: |
git tag $(jq -r ".version" package.json)
git push origin wf-dist --tags