Skip to content
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

Update the brew formula for every new release #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{ github.token }}
HOMEBREW_GITHUB_PACKAGES_USER: ${{ github.actor }}
PULL_REQUEST: ${{ github.event.pull_request.number }}
run: brew pr-pull --debug --tap=$GITHUB_REPOSITORY $PULL_REQUEST
run: brew pr-pull --debug --tap="$GITHUB_REPOSITORY" "$PULL_REQUEST"

- name: Push commits
uses: Homebrew/actions/git-try-push@master
Expand All @@ -32,4 +32,4 @@ jobs:
if: github.event.pull_request.head.repo.fork == false
env:
BRANCH: ${{ github.event.pull_request.head.ref }}
run: git push --delete origin $BRANCH
run: git push --delete origin "$BRANCH"
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@v1
uses: actions/cache@v4.0.2
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ build-iPhoneSimulator/

# Used by RuboCop. Remote config files pulled in from inherit_from directive.
# .rubocop-https?--*

#log file
pvsadm.log
36 changes: 17 additions & 19 deletions Formula/pvsadm.rb
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
class Pvsadm < Formula
desc "Tool for managing the IBM Power Systems Virtual Servers"
homepage "https://github.com/ppc64le-cloud/pvsadm"
version "0.1.11"
license "Apache-2.0"
on_macos do
on_intel do
url "https://github.com/ppc64le-cloud/pvsadm/releases/download/v0.1.11/pvsadm-darwin-amd64.tar.gz"
sha256 "7af9d26b61a032f874be6d5a040b762796651bfde1acf95188b23ad85de1a646"
end

on_arm do
url "https://github.com/ppc64le-cloud/pvsadm/releases/download/v0.1.11/pvsadm-darwin-arm64.tar.gz"
sha256 "053068fbfe6b6ea83fe285a22e0c260651714a976aee3d2c2be6529f2fbfc5f3"
if OS.mac?
if Hardware::CPU.intel?
require_relative "pvsadm_darwin_amd64"
PvsadmDarwinAmd64.new
elsif Hardware::CPU.arm?
require_relative "pvsadm_darwin_arm64"
PvsadmDarwinArm64.new
end
end

on_linux do
on_intel do
url "https://github.com/ppc64le-cloud/pvsadm/releases/download/v0.1.11/pvsadm-linux-amd64.tar.gz"
sha256 "b25e9453bdd75a11af3303783c250c93f05b3472cfe49e795bab200e5db04e03"
elsif OS.linux?
if Hardware::CPU.intel?
require_relative "pvsadm_linux_amd64"
PvsadmLinuxAmd64.new
end
end

def install
bin.install "pvsadm"
raise "Unsupported platform" unless defined? @formula

@formula.install
end

test do
output = shell_output("#{bin}/pvsadm get events 2>&1", 1)
assert_match "Error: --instance-name or --instance-name required", output
assert_match "Version: v#{version},", shell_output("#{bin}/pvsadm version | awk '{print $1, $2}'")
raise "Unsupported platform" unless defined? @formula

@formula.test
end
end
18 changes: 18 additions & 0 deletions Formula/pvsadm_darwin_amd64.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class PvsadmDarwinAmd64 < Formula
desc "Tool for managing the IBM Power Systems Virtual Servers"
homepage "https://github.com/ppc64le-cloud/pvsadm"
url "https://github.com/ppc64le-cloud/pvsadm/releases/download/v0.1.11/pvsadm-darwin-amd64.tar.gz"
version "0.1.11"
sha256 "7af9d26b61a032f874be6d5a040b762796651bfde1acf95188b23ad85de1a646"
license "Apache-2.0"

def install
bin.install "pvsadm"
end

test do
output = shell_output("#{bin}/pvsadm get events 2>&1", 1)
assert_match "Error: --instance-name or --instance-name required", output
assert_match "Version: v#{version},", shell_output("#{bin}/pvsadm version | awk '{print $1, $2}'")
end
end
18 changes: 18 additions & 0 deletions Formula/pvsadm_darwin_arm64.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class PvsadmDarwinArm64 < Formula
desc "Tool for managing the IBM Power Systems Virtual Servers"
homepage "https://github.com/ppc64le-cloud/pvsadm"
url "https://github.com/ppc64le-cloud/pvsadm/releases/download/v0.1.11/pvsadm-darwin-arm64.tar.gz"
version "0.1.11"
sha256 "053068fbfe6b6ea83fe285a22e0c260651714a976aee3d2c2be6529f2fbfc5f3"
license "Apache-2.0"

def install
bin.install "pvsadm"
end

test do
output = shell_output("#{bin}/pvsadm get events 2>&1", 1)
assert_match "Error: --instance-name or --instance-name required", output
assert_match "Version: v#{version},", shell_output("#{bin}/pvsadm version | awk '{print $1, $2}'")
end
end
18 changes: 18 additions & 0 deletions Formula/pvsadm_linux_amd64.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class PvsadmLinuxAmd64 < Formula
desc "Tool for managing the IBM Power Systems Virtual Servers"
homepage "https://github.com/ppc64le-cloud/pvsadm"
url "https://github.com/ppc64le-cloud/pvsadm/releases/download/v0.1.11/pvsadm-linux-amd64.tar.gz"
version "0.1.11"
sha256 "b25e9453bdd75a11af3303783c250c93f05b3472cfe49e795bab200e5db04e03"
license "Apache-2.0"

def install
bin.install "pvsadm"
end

test do
output = shell_output("#{bin}/pvsadm get events 2>&1", 1)
assert_match "Error: --instance-name or --instance-name required", output
assert_match "Version: v#{version},", shell_output("#{bin}/pvsadm version | awk '{print $1, $2}'")
end
end
Loading