Generate formula #8
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: Generate formula | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [generate] | |
jobs: | |
generate: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Clone formula genetator | |
run: git clone https://github.com/byrdocs/Homebrew-formula-generator.git | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
pip install ./Homebrew-formula-generator byrdocs-cli | |
- name: Get byrdocs-cli version | |
id: get_version | |
run: echo "version=$(pip list --format freeze | grep byrdocs_cli | cut -d'=' -f3)" >> "$GITHUB_OUTPUT" | |
- name: Generate formula | |
run: PYTHONPATH=Homebrew-formula-generator python -m poet -f byrdocs-cli > byrdocs-cli.rb | |
- name: Setup GIT user | |
uses: fregante/setup-git-user@v1 | |
- name: Update formula | |
run: | | |
git add byrdocs-cli.rb | |
git commit -m "Update byrdocs-cli formula to version ${{ steps.get_version.outputs.version }}" | |
git tag "v${{ steps.get_version.outputs.version }}" | |
git push origin | |
git push --tags -f |