Skip to content

Commit

Permalink
Merge pull request #24 from SiaFoundation/chris/walletd
Browse files Browse the repository at this point in the history
Add walletd
  • Loading branch information
n8maninger authored Nov 6, 2024
2 parents 17b624b + c80b07d commit 7bcf7fc
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 47 deletions.
33 changes: 19 additions & 14 deletions .github/workflows/formula-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ on:
types: [release-tagged]
workflow_dispatch:
inputs:
tag:
description: 'Version to build'
required: true
default: 'v1.0.3'
project:
description: 'Project to build'
required: true
default: 'renterd'
tag:
description: "Version to build"
required: true
default: "v1.0.3"
project:
description: "Project to build"
required: true
default: "renterd"

permissions:
contents: write
pull-requests: write

jobs:
update-formula:
Expand All @@ -32,14 +36,15 @@ jobs:
uses: actions/checkout@v3

- name: Update Homebrew Formula for ${{ env.PROJECT }}
run: sed -i 's/:tag => "[^"]*"/:tag => "${{ env.RELEASE_TAG }}"/' ./Formula/${{ env.PROJECT }}.rb
run: |
sed -i 's/tag: "[^"]*"/tag: "${{ env.RELEASE_TAG }}"/' ./Formula/${{ env.PROJECT }}.rb
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5.0.2
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: '${{ env.PROJECT }}: ${{ env.RELEASE_TAG }}'
title: '${{ env.PROJECT }}: ${{ env.RELEASE_TAG }}'
body: 'This is an automated PR to update the ${{ env.PROJECT }} formula'
delete-branch: true
commit-message: "${{ env.PROJECT }}: ${{ env.RELEASE_TAG }}"
title: "${{ env.PROJECT }}: ${{ env.RELEASE_TAG }}"
body: "This is an automated PR to update the ${{ env.PROJECT }} formula"
branch: ${{ env.PROJECT }}/update
base: master
48 changes: 25 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,35 @@ name: Test

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
test:
runs-on: macos-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up Homebrew
run: |
brew update
brew tap homebrew/cask
- name: Install
run: brew install --build-from-source Formula/*.rb

- name: Test
run: brew test Formula/*.rb

- name: Audit
run: |
for formula in Formula/*.rb; do
formula_name=$(basename $formula .rb)
brew audit --strict --online $formula_name
done
- name: Check out Git repository
uses: actions/checkout@v4

- name: Set up Homebrew
run: |
brew update
brew tap homebrew/cask
- name: Install
run: brew install --formula --build-from-source Formula/*.rb

- name: Test
run: brew test Formula/*.rb

- name: Audit
run: |
brew tap-new siafoundation/test --no-git
cp -r Formula/* $(brew --repository)/Library/Taps/siafoundation/homebrew-test/Formula
for file in $(brew --repository)/Library/Taps/siafoundation/homebrew-test/Formula/*
do
brew audit --formula "$(basename ${file%.rb})"
done
brew untap siafoundation/test
10 changes: 5 additions & 5 deletions Formula/hostd.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
class Hostd < Formula
desc "Hostd: A host for Sia"
desc "Hosting daemon for the Sia network"
homepage "https://github.com/SiaFoundation/hostd"
url "https://github.com/SiaFoundation/hostd.git", :tag => "v1.1.2"
url "https://github.com/SiaFoundation/hostd.git", tag: "v1.1.2"

depends_on "go" => :build
depends_on "gcc" => :build
depends_on "go" => :build

def install
system "go", "generate", "./..."
system "go", "build", "-tags='netgo'", "-trimpath", "-o", bin/"hostd", "-a", "-ldflags", "-s -w", "./cmd/hostd"
system "go", "build", "-tags='netgo'", "-trimpath", "-o", bin/"hostd",
"-a", "-ldflags", "-s -w", "./cmd/hostd"
end

test do
system "#{bin}/hostd", "version"
end
end

10 changes: 5 additions & 5 deletions Formula/renterd.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
class Renterd < Formula
desc "Renterd: The Next-Gen Sia Renter"
desc "Renting application for the Sia network"
homepage "https://github.com/SiaFoundation/renterd"
url "https://github.com/SiaFoundation/renterd.git", :tag => "v1.0.8"
url "https://github.com/SiaFoundation/renterd.git", tag: "v1.0.8"

depends_on "go" => :build
depends_on "gcc" => :build
depends_on "go" => :build

def install
system "go", "generate", "./..."
system "go", "build", "-tags='netgo'", "-o", bin/"renterd", "-a", "-ldflags", "-s -w", "./cmd/renterd"
system "go", "build", "-tags='netgo'", "-trimpath", "-o", bin/"renterd",
"-a", "-ldflags", "-s -w", "./cmd/renterd"
end

test do
system "#{bin}/renterd", "version"
end
end

18 changes: 18 additions & 0 deletions Formula/walletd.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class Walletd < Formula
desc "Dedicated Sia wallet"
homepage "https://github.com/SiaFoundation/walletd"
url "https://github.com/SiaFoundation/walletd.git", tag: "v0.8.0"

depends_on "gcc" => :build
depends_on "go" => :build

def install
system "go", "generate", "./..."
system "go", "build", "-tags='netgo'", "-trimpath", "-o", bin/"walletd",
"-a", "-ldflags", "-s -w", "./cmd/walletd"
end

test do
system "#{bin}/walletd", "version"
end
end
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Or `brew tap siafoundation/sia` and then `brew install <formula>`.

- [renterd](https://github.com/SiaFoundation/renterd)
- [hostd](https://github.com/SiaFoundation/hostd)
- [walletd](https://github.com/SiaFoundation/walletd)

## Documentation

Expand Down

0 comments on commit 7bcf7fc

Please sign in to comment.