-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added step to update brew formula on release
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,35 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
args: './k8s-parallel-exec-*' | ||
|
||
- name: Checkout Homebrew tap repository | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: cin/homebrew-k8s-parallel-exec | ||
|
||
- name: Update Homebrew formula | ||
run: | | ||
FORMULA_FILE="k8s-parallel-exec.rb" | ||
NEW_VERSION="${{ github.event.release.tag_name }}" | ||
sed -i "s|version \"[^\"]*\"|version \"${NEW_VERSION}\"|g" "${FORMULA_FILE}" | ||
function update_sha { | ||
local new_sha=$(sha256sum $1 | awk '{print $1}') | ||
gawk -i inplace -v platform="$1" -v new_sha="$new_sha" ' | ||
index($0, platform) { | ||
print; getline; sub(/sha256 ".*"/, "sha256 \"" new_sha "\""); | ||
}1' "${FORMULA_FILE}" | ||
} | ||
update_sha k8s-parallel-exec-linux-amd64 | ||
update_sha k8s-parallel-exec-linux-arm64 | ||
update_sha k8s-parallel-exec-darwin-amd64 | ||
update_sha k8s-parallel-exec-darwin-arm64 | ||
- name: Commit and push changes | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add "k8s-parallel-exec.rb" | ||
git commit -m "Update k8s-parallel-exec to ${{ github.event.release.tag_name }}" | ||
git push |