Skip to content

Commit 06d3e72

Browse files
authored
homebrew release (#166)
* Give write access to tap repo * Install go version from mod * Release homebrew formula * Manage agent service (#167) Drop agent name * Service instructions on installation
1 parent 1c2e1ed commit 06d3e72

File tree

2 files changed

+63
-2
lines changed

2 files changed

+63
-2
lines changed

Diff for: .github/workflows/build.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ jobs:
2828
- name: Set up Go
2929
uses: actions/setup-go@v3
3030
with:
31-
go-version: 1.19
31+
go-version-file: 'go.mod'
32+
cache: true
3233
- name: Test
3334
run: go test ./...
3435
- name: Run GoReleaser
@@ -39,7 +40,7 @@ jobs:
3940
version: latest
4041
args: release --rm-dist
4142
env:
42-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
4344
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
4445
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
4546

Diff for: .goreleaser.yml

+60
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,73 @@ builds:
1212
- mips
1313
gomips:
1414
- softfloat
15+
1516
release:
1617
github:
1718
owner: utilitywarehouse
1819
name: wiresteward
20+
1921
archives:
2022
- builds:
2123
- main
2224
format: binary
2325
files:
2426
- none*
27+
28+
brews:
29+
- name: wiresteward
30+
description: Wireguard peer manager
31+
license: MIT
32+
folder: Formula
33+
tap:
34+
owner: utilitywarehouse
35+
name: homebrew-tap
36+
caveats: |
37+
*********************
38+
When running the agent via `brew services` place your config file at `/etc/wiresteward/config.json`
39+
*********************
40+
To start the agent run:
41+
brew services start utilitywarehouse/tap/wiresteward
42+
To stop the agent run:
43+
brew services stop utilitywarehouse/tap/wiresteward
44+
To restart the agent run:
45+
brew services restart utilitywarehouse/tap/wiresteward
46+
*********************
47+
To uninstall the agent run the following commands:
48+
brew services stop utilitywarehouse/tap/wiresteward
49+
brew uninstall utilitywarehouse/tap/wiresteward
50+
launchctl remove uk.co.uw.wiresteward
51+
*********************
52+
plist: |
53+
<?xml version="1.0" encoding="UTF-8"?>
54+
<!DOCTYPE plist PUBLIC "-/Apple/DTD PLIST 1.0/EN" "http:/www.apple.com/DTDs/PropertyList-1.0.dtd">
55+
<plist version="1.0">
56+
<dict>
57+
<key>Label</key>
58+
<string>uk.co.uw.wiresteward</string>
59+
60+
<key>KeepAlive</key>
61+
<true/>
62+
63+
<key>RunAtLoad</key>
64+
<true/>
65+
66+
<key>ProgramArguments</key>
67+
<array>
68+
<string>#{bin}/wiresteward</string>
69+
<string>-agent</string>
70+
</array>
71+
72+
<key>StandardErrorPath</key>
73+
<string>/var/log/wiresteward.err.log</string>
74+
75+
<key>StandardOutPath</key>
76+
<string>/var/log/wiresteward.log</string>
77+
</dict>
78+
</plist>
79+
service: |
80+
run "#{bin}/wiresteward", "-agent"
81+
test: |
82+
system "#{bin}/wiresteward", "-version"
83+
install: |
84+
bin.install "wiresteward"

0 commit comments

Comments
 (0)