Formula Update #1467
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: "Formula Update" | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
branches: master | |
jobs: | |
update: | |
runs-on: macos-latest | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Setup requirements & Update submodules | |
run: | | |
set -x | |
python -m pip install -r Generator/requirements.txt | |
git submodule update --init --recursive | |
git submodule foreach git checkout master | |
git submodule foreach git pull | |
- name: make formula | |
working-directory: Generator | |
run: | | |
for name in appdmg bandit basher dmgbuild docutils f2format git-hg jshint macdaily mirror-config-china node-sass noob poseur pydl sloc snooty-lextudio sphinx vermin walrus zkg; do | |
echo "+ make ${name}" | |
python scripts/${name}.py || echo "::warning::command failed: ``make ${name}``" | |
done | |
- name: make fetch | |
working-directory: Generator | |
run: | | |
for name in amass dart dart-beta dart-sass pyinstaller nlohmann-json ssh-askpass uti; do | |
echo "+ make ${name}" | |
python scripts/${name}.py || echo "::warning::command failed: ``make ${name}``" | |
done | |
- name: make link | |
working-directory: Generator | |
run: | | |
make link | |
- name: Verify Changed files | |
id: verify-changed-files | |
run: | | |
set -x | |
GIT_DIFF=$(git diff --name-only | xargs) | |
echo "changed_files=${GIT_DIFF}" >> $GITHUB_OUTPUT | |
if [[ -n ${GIT_DIFF} ]]; then | |
echo "files_changed=true" >> $GITHUB_OUTPUT | |
else | |
echo "files_changed=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Commit changes | |
if: steps.verify-changed-files.outputs.files_changed == 'true' | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git commit -am"Updated formula (automatically) | |
Updated formulas at $(date). The following files | |
have been changed: ${{ steps.verify-changed-files.outputs.changed_files }}" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
if: steps.verify-changed-files.outputs.files_changed == 'true' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |