-
Notifications
You must be signed in to change notification settings - Fork 40
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
Automates brew formula version bump for new release #687
Automates brew formula version bump for new release #687
Conversation
Depends on ppc64le-cloud/homebrew-pvsadm#7 |
.github/workflows/release.yml
Outdated
GH_TOKEN: ${{ secrets.GH_TOKEN}} | ||
run: | | ||
cd ci/ | ||
chmod +x brew_formula_updater.sh |
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.
can you change the permission while pushing this file itself?
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.
Done
git config --global user.name "pvsadm GitHub Actions" | ||
git config --global user.email "[email protected]" |
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.
who is the real owner of this token who is going to push the change? may that user name configuration is more relevant.
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.
The owner would be the same as to the existing GITHUB_TOKEN
earlier set in the repo Action secrets. Since this automation is handled by Actions I have set the author as such to denote its a commit made by automated process.
.github/workflows/release.yml
Outdated
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN}} | ||
run: | | ||
cd ci/ |
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.
can we use the fullpath instead of changing the directory?
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.
Done
ci/brew_formula_updater.sh
Outdated
exit 1 | ||
fi | ||
|
||
cd brew_tap_repo_temp || { echo "Error: Failed to navigate to brew_tap_repo_temp"; exit 1; } |
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.
use mktemp command to generate the temporary folder and assign it to variable and use it everywhere.
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.
Done
ci/brew_formula_updater.sh
Outdated
cd brew_tap_repo_temp || { echo "Error: Failed to navigate to brew_tap_repo_temp"; exit 1; } | ||
BRANCH_NAME="bump_formula_v$NEW_VERSION" | ||
git checkout -b "$BRANCH_NAME" || { echo "Error: Failed to create branch $BRANCH_NAME"; exit 1; } | ||
cd "$FORMULA_PATH" || { echo "Error: Failed to navigate to $FORMULA_PATH"; exit 1; } |
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.
use pushd, popd wherever needed.
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.
Done
a862169
to
fe19ccb
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: carmal891, mkumatag The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Automates the process of updating the Brew formula version in the tap repository (ppc64le-cloud/homebrew-pvsadm) for each platform-dependent formula (linux_amd64, darwin_arm64, darwin_amd64) to reflect the latest release version upon new releases in this repository.
This PR addresses issue #667 and resumes the changes from #675, which was previously put on hold due to the limitations of the proposed solutions utilizing GitHub Actions:
dawidd6/action-homebrew-bump-formula
mislav/bump-homebrew-formula-action
Above actions are unable to correctly parse and update a nested/custom formula file as maintained in ppc64le-cloud/homebrew-pvsadm. Additionally, the approach of maintaining three separate formulas did not work out for the reasons outlined here: ppc64le-cloud/homebrew-pvsadm#6
As discussed, alternate solution uses a custom Bash script to update the formula file. The script has been thoroughly tested against a personal forked repository.
NOTE:
It requires additional token to create PR using GH cli in the name GH_TOKEN. Required scopes include read:org, repo, workflow, write:packages