Update Icons #166
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" |