-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (58 loc) · 1.91 KB
/
main.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
name: Build TMIcons
on:
push:
branches:
- main
paths:
- 'data/**'
jobs:
update-file:
runs-on: ubuntu-latest
steps:
- name: Set up Node.js 20
uses: actions/setup-node@v3
- name: Checkout repository
uses: actions/checkout@v2
- name: Build SVG files
run: |
node ./script/build-icon-svg.js
- name: Build Tonic UI icons data
run: |
npm i
echo "Tonic UI data built successfully."
- name: Convert SVG to PNG files
run: |
node ./script/svg2png.js
- name: Commit svg icons, png files, and Tonic UI data
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
majorVersion=$(jq -r '.fontPref.metadata.majorVersion' data/Preferences.json)
minorVersion=$(jq -r '.fontPref.metadata.minorVersion' data/Preferences.json)
version="$majorVersion.$minorVersion.0"
echo "version=$version" >> $GITHUB_ENV
jq --arg new_version "$version" '.version = $new_version' package.json > tmp.json && mv tmp.json package.json
git config --global user.name 'HIE UX Service'
git config --global user.email '[email protected]'
commit_message=$(git log -n 1 --pretty=format:%B)
echo "$commit_message" > last_commit.txt
echo "description<<EOF" >> $GITHUB_ENV
echo "$commit_message" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
git status
git add --all
git reset last_commit.txt
git commit -F last_commit.txt
git push
git tag "v$version"
git push origin "v$version"
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: v${{ env.version }}
release_name: TMIcon <v${{ env.version }}>
body: ${{ env.description }}
draft: false
prerelease: false