-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (33 loc) · 1.5 KB
/
readme.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
name: Generate README for homebrew tap
permissions:
contents: write
on:
workflow_dispatch:
push:
jobs:
build:
name: Build and deploy new README
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: |
echo -e "## RustLangES homebrew tap packages\n\nThis repository contains formulas for installing axo's projects using [Homebrew](https://brew.sh) on Mac.\n## Homebrew Packages\n">README.md
for file in ./Formula/*.rb; do
[ -e "$file" ] || continue
name=$(grep 'bin.install "' $file | sed 's/bin.install "//g;s/"$//g;s/^[ \\t]*//;')
version=$(grep 'version "' $file | sed 's/version "//g;s/"$//g;s/^[ \\t]*//;')
desc=$(grep 'desc "' $file | sed 's/desc "//g;s/"$//g;s/^[ \\t]*//;')
repo=$(grep 'homepage "' $file | sed 's/homepage "//g;s/"$//g;s/^[ \\t]*//;')
echo -e "---\n### ${name} - ${version}\n${desc}\n> [!NOTE]\n> You can check the proyect [here](${repo})\n\`\`\`bash\nbrew install RustLangES/homebrew-tap/${name}\n\`\`\`\n" >>README.md
done
- name: Deploy
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USER: "github-actions[bot]"
GITHUB_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
run: |
git config --global user.name "${GITHUB_USER}"
git config --global user.email "${GITHUB_EMAIL}"
git add -A && git commit -m "update readme"
git push origin main