-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (63 loc) · 2.48 KB
/
update-icons.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
name: Update @l3-lib/ui-style
on:
schedule:
- cron: "*/10 * * * *"
jobs:
get-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fetch release version
run: |
echo "installed version"
node -p "require('./package.json').dependencies['@l3-lib/ui-style']"
echo "latest version"
npm show @l3-lib/ui-style version
echo "CURRENT_VERSION=$(node -p "require('./package.json').dependencies['@l3-lib/ui-style']")" >> $GITHUB_ENV
echo "LATEST_VERSION=$(npm show @l3-lib/ui-style version)" >> $GITHUB_ENV
- name: Read release version
id: read-release-version
run: |
echo "var current"
echo "${{ env.CURRENT_VERSION }}"
echo "var latest"
echo "${{ env.LATEST_VERSION }}"
echo ::set-output name=branch_exists::$([ -z "`git ls-remote --heads origin update-version/style-version-${{env.LATEST_VERSION}}`" ] && echo "false" || echo "true")
- name: Same version
if: ${{ env.CURRENT_VERSION == env.LATEST_VERSION }}
run: |
echo "same version"
- name: Not same version - install & check changes
id: git-check
if: ${{ env.CURRENT_VERSION != env.LATEST_VERSION && steps.read-release-version.outputs.branch_exists == 'false' }}
run: |
echo "Not same version"
npm install @l3-lib/ui-style@${{env.LATEST_VERSION}} --save-exact
echo ::set-output name=modified::$([ -z "`git status --porcelain`" ] && echo "false" || echo "true")
- name: Build react icons
if: steps.git-check.outputs.modified == 'true'
id: build-react-icons
run: |
npm install
npm run build:react-icons
echo ::set-output name=success::$(echo "true")
- name: Create a pr
if: steps.build-react-icons.outputs.success == 'true'
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update version
committer: L3vels Style <[email protected]>
author: L3vels Style <[email protected]>
branch: update-version/style-version-${{env.LATEST_VERSION}}
title: "Upgrade icons"
body: |
New icons version
labels: |
PR: Icon 💎
assignees: orrgottlieb
reviewers: orrgottlieb
team-reviewers: |
owners
maintainers
draft: false