-
Notifications
You must be signed in to change notification settings - Fork 58
chore(CI): Update homebrew formula on release #5433
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
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
3be7774
chore(CI): Update homebrew formula on release
DaughterOfMars 195e0dc
dprint
DaughterOfMars 52ad8f4
temp for testing
DaughterOfMars 92061b4
Merge branch 'develop' into dev-tools/update-homebrew
DaughterOfMars 4bc4c6a
temp for testing
DaughterOfMars 9bedd1d
change runs-on
DaughterOfMars 4695e1c
try something else
DaughterOfMars d00cdab
try updating action
DaughterOfMars 9f28926
manually create PR
DaughterOfMars 887f292
install homebrew
DaughterOfMars 06b7ff2
remove check
DaughterOfMars 1a35f56
remove dot
DaughterOfMars 202ca23
checkout
DaughterOfMars c2f4bef
chmod
DaughterOfMars 2ab2e49
fixes
DaughterOfMars df126a1
quote title
DaughterOfMars 0ae1963
more fixes
DaughterOfMars d24cc32
try using token
DaughterOfMars f1b04a7
even more fixes
DaughterOfMars 5510ac2
try config
DaughterOfMars d3d7334
try moving it?
DaughterOfMars ff119d0
last thing
DaughterOfMars 87f1a8d
remove the v
DaughterOfMars 6dc165a
uncomment
DaughterOfMars 79d99bd
cleanup
DaughterOfMars efc9edf
revert commented condition
DaughterOfMars 4931c4f
Update .github/workflows/release.yml
DaughterOfMars 99974ab
remove versionless_tag
DaughterOfMars 9e115d9
remove artifact_name
DaughterOfMars 455fc2d
Merge branch 'develop' into dev-tools/update-homebrew
thibault-martinez bdcf3cb
update comment
DaughterOfMars 1279e17
Merge branch 'dev-tools/update-homebrew' of https://github.com/iotale…
DaughterOfMars f92aa4b
clean up
DaughterOfMars ef65dd2
fix comment
DaughterOfMars 6d17f0e
use release page instead of workflow run
DaughterOfMars 98134ca
Update scripts/homebrew/update_formula.sh
DaughterOfMars 48b732d
review
DaughterOfMars 90c2996
Merge branch 'dev-tools/update-homebrew' of https://github.com/iotale…
DaughterOfMars File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ## Description | ||
|
|
||
| A new release has been published on {{server_url}}/{{repository}}: [`{{repository}} {{tag}}`]({{server_url}}/{{repository}}/releases/tag/{{tag}}) |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| class Iota < Formula | ||
| desc "Bringing the real world to Web3 with a scalable, decentralized and programmable DLT infrastructure" | ||
| homepage "https://www.iota.org" | ||
| license "Apache-2.0" | ||
|
|
||
| version "{{version}}" | ||
| checksums = { | ||
| "macos-arm64" => "{{macos-arm64-checksum}}", | ||
| "linux-x86_64" => "{{linux-x86_64-checksum}}" | ||
| } | ||
| arch = "" | ||
|
|
||
| on_macos do | ||
| on_arm do | ||
| arch = "macos-arm64" | ||
| end | ||
| end | ||
|
|
||
| on_linux do | ||
| on_intel do | ||
| arch = "linux-x86_64" | ||
| end | ||
| end | ||
|
|
||
| # Return with error if no compatible architecture was found. | ||
| odie "Unsupported architecture #{Hardware::CPU.arch.to_s}-#{OS.kernel_name}. Please use cargo install and build from source" if arch == "" | ||
|
|
||
| url "https://github.com/iotaledger/iota/releases/download/v#{version}/iota-v#{version}-#{arch}.tgz" | ||
| sha256 checksums[arch] | ||
|
|
||
| def install | ||
| bin.install "iota" => "iota" | ||
| bin.install "iota-tool" => "iota-tool" | ||
| end | ||
|
|
||
| # TODO if arch is empty, build from source | ||
|
|
||
| test do | ||
| assert_match version.to_s, shell_output("#{bin}/iota --version") | ||
|
|
||
| (testpath/"test.keystore").write <<~EOS | ||
| [ | ||
| "iotaprivkey1qrg9875hq63wqnya0hy3khlkfjvarp009chky42uu2gu9c2dsv32qk8r7ae" | ||
| ] | ||
| EOS | ||
| keystore_output = shell_output("#{bin}/iota keytool --keystore-path test.keystore list") | ||
| assert_match "0x7f21a048ec0e1d82d2e4a89a3b304e12813cafce1e8410f7a8d3be33c214c422", keystore_output | ||
| end | ||
| end |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #!/bin/bash | ||
|
|
||
| ROOT=$(git rev-parse --show-toplevel || realpath "$(dirname "$0")/../..") | ||
DaughterOfMars marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| tag=$1 | ||
| org=${2:-"iotaledger"} | ||
| repository=${3:-"iota"} | ||
thibault-martinez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if [ -z "$GH_TOKEN" ]; then | ||
| echo "Environment variable GH_TOKEN must be set!" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Remove leading `v` from tag | ||
| version=$(echo "${tag}" | sed -En "s|v?(.+)|\1|p") | ||
thibault-martinez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| server_url="https://github.com/${org}" | ||
| auth_url="https://${GH_TOKEN}@github.com/${org}" | ||
|
|
||
| checksums=${ROOT}/checksum.txt | ||
|
|
||
| macos_arm64_checksum=$(sed -En 's/^.*macos-arm64.*([0-9a-f]{64})$/\1/p' "${checksums}") | ||
| linux_x86_64_checksum=$(sed -En 's/^.*linux-x86_64.*([0-9a-f]{64})$/\1/p' "${checksums}") | ||
|
|
||
| git clone "${auth_url}"/homebrew-tap homebrew-tap | ||
| cd homebrew-tap || exit | ||
| git checkout -b "${repository}"-"${tag}" | ||
|
|
||
| formula="Formula/${repository}.rb" | ||
| pr_template=$(cat "${ROOT}"/scripts/homebrew/pr_template.md) | ||
|
|
||
| pr_description=$(echo "${pr_template}" | \ | ||
| sed "s|{{server_url}}|${server_url}|g" | \ | ||
| sed "s|{{repository}}|${repository}|g" | \ | ||
| sed "s|{{tag}}|${tag}|g") | ||
|
|
||
| cp -rf "${ROOT}"/scripts/homebrew/template "${formula}" | ||
|
|
||
| sed -i -e "s|{{version}}|${version}|g" "${formula}" | ||
| sed -i -e "s|{{macos-arm64-checksum}}|${macos_arm64_checksum}|g" "${formula}" | ||
| sed -i -e "s|{{linux-x86_64-checksum}}|${linux_x86_64_checksum}|g" "${formula}" | ||
|
|
||
| title="Update brew formula for ${repository} ${tag}" | ||
|
|
||
| git config user.name "IOTA Foundation" | ||
| git config user.email "[email protected]" | ||
|
|
||
| git add "${formula}" | ||
| git commit -m "${title}" | ||
| git push --set-upstream origin "${repository}"-"${tag}" | ||
|
|
||
| gh pr create --base main --title "${title}" --body "${pr_description}" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.