-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Homebrew Tap Capability #520
Conversation
- updated platform-release.yaml to include steps required for homebrew tap functionality -updated .goreleaser.darwin.yaml to export MacOS binaries in both .zip and .tar.gz formats - added create-homebrew-recipe.awk - added kitops.rb.template
suggestion from Angel Co-authored-by: Angel Misevski <amisevsk@gmail.com>
Incorporated Angel's feedback
…i/kitops into homebrew-tap-capabilities
Fixed indention issues
removed i386 from supported MacOS builds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good -- I've left a few nitpicky comments here and there
I don't understand ruby or awk well enough to review those bits though.
@@ -1,6 +1,6 @@ | |||
name: Release with Platform builds | |||
|
|||
on: | |||
on: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few trailing spaces on lines in this file (in VS Code, use cmd+k, cmd+z
to trim)
run: | | ||
shopt -s failglob | ||
pushd dist | ||
shasum -a 256 kitops-* > checksums.txt | ||
mv checksums.txt kitops_${TAG_NAME}_checksums.txt | ||
cp kitops_${TAG_NAME}_checksums.txt ../homebrew-files/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary dot
cp kitops_${TAG_NAME}_checksums.txt ../homebrew-files/. | |
cp kitops_${TAG_NAME}_checksums.txt ../homebrew-files/ |
awk ' | ||
BEGIN { tag_name = ENVIRON["TAG_NAME"]; repo = ENVIRON["REPO"];} | ||
/.tar.gz$/ { | ||
print "\""$1"\"", | ||
"\"https://github.com/" repo "/releases/download/" tag_name "/" $2 "\"", | ||
$2, | ||
tag_name }' kitops_${TAG_NAME}_checksums.txt | | ||
awk '{ sub(/.tar.gz/, "", $3); print $1, $2, $3, $4 }' | | ||
awk '{ sub(/kitops-/, "", $3); print $1, $2, $3, $4 }' | | ||
awk '{sub(/v/, "", $4); print $1, $2, $3, $4 }' > homebrew-metadata.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm taking it on faith that this does whatever it is supposed to -- awk is a write-only language :D
Consider add comments describing what each step does?
run: | | ||
cp -f ./homebrew-files/homebrew-metadata.txt ./homebrew-kitops/. | ||
cp -f ./homebrew-files/kitops.rb ./homebrew-kitops/. | ||
pushd homebrew-kitops | ||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
PR_BRANCH="${{ github.ref_name }}-homebrew-tap-update" | ||
git fetch origin main | ||
git branch "$PR_BRANCH" | ||
git checkout "$PR_BRANCH" | ||
git pull origin --ff-only "${PR_BRANCH}" || true | ||
git config --global user.name "${GITHUB_ACTOR}" | ||
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" | ||
git add --all | ||
git commit -m "homebrew: update Homebrew Tap Formula for ${{ github.ref_name }}" | ||
git push origin "${PR_BRANCH}" | ||
gh pr create --fill --base main --head "${PR_BRANCH}" | ||
git checkout "${CURRENT_BRANCH}" | ||
popd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could potentially be simpler using peter-evans/create-pull-request -- IIRC we use this elsewhere
Description
Linked issues