-
-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (68 loc) · 2.47 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
72
73
74
75
76
77
78
79
80
81
82
name: Update Icons
on:
workflow_dispatch:
schedule:
- cron: 0 14 * * 0
jobs:
update:
runs-on: ubuntu-latest
name: Update Simple Icons
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
token: ${{ secrets.TOKEN_BOT }}
persist-credentials: false
fetch-depth: 0
- id: current-version
name: Get current version
uses: juliangruber/read-file-action@v1
with:
path: ./version.json
- id: latest-version
name: Get latest Simple Icons version
uses: pozetroninc/[email protected]
with:
repository: simple-icons/simple-icons
excludes: prerelease, draft
- name: Add versions to environment
run: |
echo "CURRENT_VERSION=${{ fromJSON(steps.current-version.outputs.content).current }}" >> $GITHUB_ENV
echo "LATEST_VERSION=${{ steps.latest-version.outputs.release }}" >> $GITHUB_ENV
- name: Output versions
run: |
echo "Current release: ${{ env.CURRENT_VERSION }}"
echo "Latest release: ${{ env.LATEST_VERSION }}"
- name: Update submodule
if: env.CURRENT_VERSION != env.LATEST_VERSION
uses: actions/checkout@v2
with:
token: ${{ secrets.TOKEN_BOT }}
repository: simple-icons/simple-icons
ref: ${{ env.LATEST_VERSION }}
path: ./dist
- name: Setup PHP
if: env.CURRENT_VERSION != env.LATEST_VERSION
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
tools: composer
coverage: none
- name: Install dependencies
if: env.CURRENT_VERSION != env.LATEST_VERSION
run: composer update --no-interaction --no-progress --dev
- name: Generate icons
if: env.CURRENT_VERSION != env.LATEST_VERSION
run: composer run generate-icons
- name: Update version in "version.json"
if: env.CURRENT_VERSION != env.LATEST_VERSION
run: echo '{ "current":"${{ env.LATEST_VERSION }}" }'>./version.json
- name: Push changes
if: env.CURRENT_VERSION != env.LATEST_VERSION
uses: actions-js/push@master
with:
github_token: ${{ secrets.TOKEN_BOT }}
author_email: ${{ secrets.BOT_EMAIL }}
author_name: ${{ secrets.BOT_NAME }}
branch: feature/update-icons
message: "feat(svg): update to Simple Icons v${{ env.LATEST_VERSION }}"