Skip to content

Commit

Permalink
Update update-tap.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
PurpleBooth authored Jun 5, 2020
1 parent 0245aec commit 4b901a5
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/update-tap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,28 @@
tags:
- '*'
jobs:
generate_formula:
runs-on: ubuntu-latest
steps:
- uses: cuchi/jinja2-action@v1.1.0
with:
template: source-repo/homebrew/formula.rb.j2
output_file: formula.rb
variables: |
github_repo=${{ github.repository }}
git_tag=${{ github.ref }}
git_sha=${{ github.sha }}
- uses: actions/upload-artifact@v2
with:
name: formula
path: ./formula.rb
build:
runs-on: macos-latest
steps:
- id: get_repository_name
run: echo ::set-output name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")
shell: bash
- uses: actions/download-artifact@v2
- uses: actions/checkout@v2
with:
repository: PurpleBooth/homebrew-repo
Expand All @@ -18,21 +34,13 @@ jobs:
with:
token: ${{ secrets.COMMITTER_TOKEN }}
path: source-repo
- uses: cuchi/jinja2-action@v1.1.0
with:
template: source-repo/homebrew/formula.rb.j2
output_file: formula.rb
variables: |
github_repo=${{ github.repository }}
git_tag=${{ github.ref }}
git_sha=${{ github.sha }}
- shell: bash
run: |
set -euo pipefail
FORMULA_LOCATION="homebrew-repo/Formula/$REPOSITORY_NAME.rb"
if [ ! -f "$FORMULA_LOCATION" ] || ! grep -q $GITHUB_SHA "$FORMULA_LOCATION" ; then
cp formula.rb "homebrew-repo/Formula/$REPOSITORY_NAME.rb"
cp formula/formula.rb "homebrew-repo/Formula/$REPOSITORY_NAME.rb"
fi
cp -r ./homebrew-repo "$(brew --repo)/Library/Taps/purplebooth/homebrew-repo"
Expand Down

0 comments on commit 4b901a5

Please sign in to comment.