diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 82fed3b..bb15080 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,7 +46,7 @@ jobs: pactflow --help - - name: Audit tap (⚠️ experimental ⚠️) - so we ignore the error code + - name: Audit tap run: | - brew audit --strict --online pact-ruby-standalone || true + brew audit --strict --online pact-ruby-standalone diff --git a/Aliases/pact-ruby-standalone@2 b/Aliases/pact-ruby-standalone@2 new file mode 120000 index 0000000..d691140 --- /dev/null +++ b/Aliases/pact-ruby-standalone@2 @@ -0,0 +1 @@ +../pact-ruby-standalone.rb \ No newline at end of file diff --git a/README.md b/README.md index 0dcf2e5..738c49d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ The Pact Ruby Standalone public homebrew tap for OS X homebrew formulae. The easier way to install [`pact-ruby-standalone`](https://github.com/pact-foundation/pact-ruby-standalone) bundle of tools on your macOS using Homebrew. - ## Installation brew tap pact-foundation/pact-ruby-standalone @@ -15,8 +14,9 @@ The easier way to install [`pact-ruby-standalone`](https://github.com/pact-found | OS | Architecture | Supported | | ------- | ------------ | --------- | | OSX | x86_64 | ✅ | -| OSX | aarch64 (arm)| ✅ | +| OSX | arm64 | ✅ | | Linux | x86_64 | ✅ | +| Linux | arm64 | ✅ | ## Included tools @@ -33,7 +33,15 @@ The easier way to install [`pact-ruby-standalone`](https://github.com/pact-found pactflow --help ``` -### Notes +### Previous versions + +The latest version, of the previous major release is provided, in case of issues with the latest version installed by default. + + brew install pact-ruby-standalone@1 + +#### Notes + +For v1.x and below - OSX ARM (M1/M2) Machines will require Rosetta tools, as the Ruby binaries as currently built for x86_64. @@ -41,4 +49,4 @@ If you don't already have it installed, you can use the following command ```sh sudo softwareupdate --install-rosetta --agree-to-license -``` +``` \ No newline at end of file diff --git a/pact-ruby-standalone.rb b/pact-ruby-standalone.rb index f0c83a4..ca6c43e 100644 --- a/pact-ruby-standalone.rb +++ b/pact-ruby-standalone.rb @@ -1,21 +1,25 @@ class PactRubyStandalone < Formula desc "Standalone pact CLI executable using the Ruby Pact impl and Travelling Ruby" homepage "https://github.com/pact-foundation/pact-ruby-standalone" - version "1.92.0" + version "2.0.2" on_macos do on_intel do - url "https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.92.0/pact-1.92.0-osx.tar.gz" - sha256 "dee18427b9eced63a159d5e64c5ff0d7aa2d4a1e67255b24b239c007c2c8b6c1" + url "https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.0.2/pact-2.0.2-osx-x86_64.tar.gz" + sha256 "072766ea5fe6ce4228022c068b9b4889cd70537a913d6e253839cf7616fdb54b" end on_arm do - url "https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.92.0/pact-1.92.0-osx.tar.gz" - sha256 "dee18427b9eced63a159d5e64c5ff0d7aa2d4a1e67255b24b239c007c2c8b6c1" + url "https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.0.2/pact-2.0.2-osx-arm64.tar.gz" + sha256 "f0acdef27afa6c1837c37960568787b5c25d0f8e71fbd9ee232bf6aac6dfc0b2" end end on_linux do on_intel do - url "https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.92.0/pact-1.92.0-linux-x86_64.tar.gz" - sha256 "a5922e4098cae6f8717b9d51fda050d30540dff657c44f61eed9d51875f7822a" + url "https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.0.2/pact-2.0.2-linux-x86_64.tar.gz" + sha256 "5c28a99b0309adb6ed8cb15bafb86c92fa4c49971b8019e4036f27b7e66e0588" + end + on_arm do + url "https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.0.2/pact-2.0.2-linux-arm64.tar.gz" + sha256 "91f11de10077bfde1c37c6aaa69e9258288ab7f8ff4fb48f592ffce8665427c8" end end @@ -24,10 +28,6 @@ def install bin.install Dir["bin/*"] lib.install Dir["lib/*"] puts "# Run 'pact-mock-service --help' (see https://github.com/pact-foundation/pact-ruby-standalone/releases/)" - OS.mac? && Hardware::CPU.arm? do - puts "# Rosetta is required to run pact-ruby-standalone commands" - puts "# sudo softwareupdate --install-rosetta --agree-to-license" - end end test do @@ -36,7 +36,6 @@ def install system "#{bin}/pact-message", "help" system "#{bin}/pact-mock-service", "help" system "#{bin}/pact-plugin-cli", "help" - system "#{bin}/pact-mock-service", "help" system "#{bin}/pact-provider-verifier", "help" system "#{bin}/pact-stub-service", "help" system "#{bin}/pactflow", "help" diff --git a/pact-ruby-standalone@1.rb b/pact-ruby-standalone@1.rb new file mode 100644 index 0000000..b7be7f8 --- /dev/null +++ b/pact-ruby-standalone@1.rb @@ -0,0 +1,54 @@ +class PactRubyStandaloneAT1 < Formula + desc "Standalone pact CLI executable using the Ruby Pact impl and Travelling Ruby" + homepage "https://github.com/pact-foundation/pact-ruby-standalone" + version "1.92.0" + + on_macos do + on_arm do + url "https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.92.0/pact-1.92.0-osx.tar.gz" + sha256 "dee18427b9eced63a159d5e64c5ff0d7aa2d4a1e67255b24b239c007c2c8b6c1" + end + on_intel do + url "https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.92.0/pact-1.92.0-osx.tar.gz" + sha256 "dee18427b9eced63a159d5e64c5ff0d7aa2d4a1e67255b24b239c007c2c8b6c1" + end + end + + on_linux do + on_intel do + url "https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.92.0/pact-1.92.0-linux-x86_64.tar.gz" + sha256 "a5922e4098cae6f8717b9d51fda050d30540dff657c44f61eed9d51875f7822a" + end + end + + def install + # pact-ruby-standalone + bin.install Dir["bin/*"] + lib.install Dir["lib/*"] + puts "# (see https://github.com/pact-foundation/pact-ruby-standalone/releases/)'" + puts "# Run 'pact --help'" + puts "# Run 'pact-broker --help'" + puts "# Run 'pact-message --help'" + puts "# Run 'pact-mock-service --help'" + puts "# Run 'plugin-cli --help'" + puts "# Run 'pact-provider-verifier --help'" + puts "# Run 'pact-stub-service --help'" + puts "# Run 'pactflow --help'" + on_macos do + on_arm do + puts "# Rosetta is required to run pact-ruby-standalone commands" + puts "# sudo softwareupdate --install-rosetta --agree-to-license" + end + end + end + + test do + system "#{bin}/pact", "help" + system "#{bin}/pact-broker", "help" + system "#{bin}/pact-message", "help" + system "#{bin}/pact-mock-service", "help" + system "#{bin}/pact-provider-verifier", "help" + system "#{bin}/pact-stub-service", "help" + system "#{bin}/pactflow", "help" + end +end \ No newline at end of file diff --git a/scripts/update_tap_version.sh b/scripts/update_tap_version.sh index d9944a1..9e8defb 100755 --- a/scripts/update_tap_version.sh +++ b/scripts/update_tap_version.sh @@ -19,12 +19,12 @@ write_homebrew_formulae() { echo " version \"$version\"" >&3 echo " on_macos do" >&3 echo " on_intel do" >&3 - echo " url \"$homepage/releases/download/v$version/pact-$version-osx.tar.gz\"" >&3 + echo " url \"$homepage/releases/download/v$version/pact-$version-osx-x86_64.tar.gz\"" >&3 echo " sha256 \"${sha_osx_x86_64}\"" >&3 echo " end" >&3 echo " on_arm do" >&3 - echo " url \"$homepage/releases/download/v$version/pact-$version-osx.tar.gz\"" >&3 - echo " sha256 \"${sha_osx_x86_64}\"" >&3 + echo " url \"$homepage/releases/download/v$version/pact-$version-osx-arm64.tar.gz\"" >&3 + echo " sha256 \"${sha_osx_arm64}\"" >&3 echo " end" >&3 echo " end" >&3 echo " on_linux do" >&3 @@ -32,6 +32,10 @@ write_homebrew_formulae() { echo " url \"$homepage/releases/download/v$version/pact-$version-linux-x86_64.tar.gz\"" >&3 echo " sha256 \"${sha_linux_x86_64}\"" >&3 echo " end" >&3 + echo " on_arm do" >&3 + echo " url \"$homepage/releases/download/v$version/pact-$version-linux-arm64.tar.gz\"" >&3 + echo " sha256 \"${sha_linux_arm64}\"" >&3 + echo " end" >&3 echo " end" >&3 echo "" >&3 echo " def install" >&3 @@ -39,17 +43,12 @@ write_homebrew_formulae() { echo " bin.install Dir[\"bin/*\"]" >&3 echo " lib.install Dir[\"lib/*\"]" >&3 echo " puts \"# Run 'pact-mock-service --help' (see $homepage/releases/)\"" >&3 - echo " OS.mac? && Hardware::CPU.arm? do" >&3 - echo " puts \"# Rosetta is required to run pact-ruby-standalone commands\"" >&3 - echo " puts \"# sudo softwareupdate --install-rosetta --agree-to-license\"" >&3 - echo " end" >&3 echo " end" >&3 echo "" >&3 echo " test do" >&3 echo " system \"#{bin}/pact\", \"help\"" >&3 echo " system \"#{bin}/pact-broker\", \"help\"" >&3 echo " system \"#{bin}/pact-message\", \"help\"" >&3 - echo " system \"#{bin}/pact-mock-service\", \"help\"" >&3 echo " system \"#{bin}/pact-plugin-cli\", \"help\"" >&3 echo " system \"#{bin}/pact-mock-service\", \"help\"" >&3 echo " system \"#{bin}/pact-provider-verifier\", \"help\"" >&3 @@ -80,18 +79,13 @@ else shas=() for platform in osx linux; do - for arch in x86_64; do - if [[ ${platform} == "osx" ]] - then - filename=pact-$version-${platform} - else - filename=pact-$version-${platform}-${arch} - fi + for arch in x86_64 arm64; do + filename=pact-$version-${platform}-${arch} echo "⬇️ Downloading $filename.tar.gz from $homepage" curl -LO $homepage/releases/download/v$version/$filename.tar.gz brewshasignature=( $(eval "openssl dgst -sha256 $filename.tar.gz") ) - echo "🔏 Checksum SHA256:\t ${brewshasignature[1]} for ${arch}" + echo "🔏 Checksum SHA256:\t ${brewshasignature[1]} for ${platform}-${arch}" shasignature=( $(eval "openssl dgst -sha1 $filename.tar.gz") ) echo "🔏 Checksum SHA1:\t ${shasignature[1]} for ${platform}-${arch}" @@ -119,9 +113,13 @@ for platform in osx linux; do done sha_osx_x86_64=${shas[0]} - sha_linux_x86_64=${shas[1]} + sha_osx_arm64=${shas[1]} + sha_linux_x86_64=${shas[2]} + sha_linux_arm64=${shas[3]} echo "sha_osx_x86_64:" $sha_osx_x86_64 + echo "sha_osx_arm64:" $sha_osx_arm64 echo "sha_linux_x86_64:" $sha_linux_x86_64 + echo "sha_linux_arm64:" $sha_linux_arm64 write_homebrew_formulae