Auto Update #5579
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: Auto Update | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 */6 * * *' | |
jobs: | |
versions: | |
runs-on: ubuntu-latest | |
name: Get Versions | |
outputs: | |
current: ${{ steps.current-version.outputs.content }} | |
latest: ${{ steps.latest-version.outputs.tag }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- id: current-version | |
name: Get current Font Awesome version | |
uses: juliangruber/read-file-action@v1 | |
with: | |
trim: true | |
path: ./.version | |
- id: latest-version | |
name: Get latest Font Awesome version | |
uses: oprypin/find-latest-tag@v1 | |
with: | |
repository: FortAwesome/Font-Awesome | |
regex: '^\d+\.\d+\.\d+$' | |
- name: Output versions | |
run: | | |
echo "Current release: ${{ steps.current-version.outputs.content }}" | |
echo "Latest release: ${{ steps.latest-version.outputs.tag }}" | |
update: | |
runs-on: ubuntu-latest | |
name: Update Font Awesome | |
needs: [versions] | |
if: needs.versions.outputs.current != needs.versions.outputs.latest | |
env: | |
CURRENT_VERSION: ${{ needs.versions.outputs.current }} | |
LATEST_VERSION: ${{ needs.versions.outputs.latest }} | |
BRANCH: feature/update-${{ needs.versions.outputs.latest }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
coverage: none | |
- name: Install Dependencies | |
run: composer update --prefer-stable --no-interaction --prefer-dist --no-progress --ansi | |
- name: Update to latest version | |
run: npm install "@fortawesome/fontawesome-free@${{ env.LATEST_VERSION }}" --save-dev | |
- name: Compile icons to resources directory | |
run: vendor/bin/blade-icons-generate | |
- name: Update version in ".version" | |
run: echo ${{ env.LATEST_VERSION }}>./.version | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
push: false | |
message: "chore: update to Font Awesome v${{ env.LATEST_VERSION }}" | |
author_name: GitHub Actions | |
author_email: noreply@github.com | |
- name: Update test snapshots | |
run: vendor/bin/pest --update-snapshots | |
- name: Commit changes | |
id: commit_snapshots | |
uses: EndBug/add-and-commit@v9 | |
with: | |
push: false | |
message: "tests: update snapshots for v${{ env.LATEST_VERSION }}" | |
author_name: GitHub Actions | |
author_email: noreply@github.com | |
add: 'tests/.pest/snapshots/*' | |
- name: Create PR for latest version | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
title: "chore: update to Font Awesome v${{ env.LATEST_VERSION }}" | |
branch: "feature/auto-update-${{ env.LATEST_VERSION }}" | |
body: | | |
This updates from [${{ env.CURRENT_VERSION }}](https://github.com/FortAwesome/Font-Awesome/releases/tag/${{ env.CURRENT_VERSION }}) to [${{ env.LATEST_VERSION }}](https://github.com/FortAwesome/Font-Awesome/releases/tag/${{ env.LATEST_VERSION }}). | |
Check out the differences: [`${{ env.CURRENT_VERSION }}` ... `${{ env.LATEST_VERSION }}`](https://github.com/FortAwesome/Font-Awesome/compare/${{ env.CURRENT_VERSION }}...${{ env.LATEST_VERSION }}) | |
Please check for any breaking or notable changes before merging. | |
- [Changelog](https://fontawesome.com/docs/changelog) | |
- [Upgrade Guide](https://github.com/FortAwesome/Font-Awesome/blob/${{ env.LATEST_VERSION }}/UPGRADING.md#upgrading-guide) | |
Please also check that the snapshots were updated successfully in commit: [${{ steps.commit_snapshots.outputs.commit_long_sha }}](https://github.com/owenvoke/blade-fontawesome/commit/${{ steps.commit_snapshots.outputs.commit_long_sha }}). |