-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (86 loc) · 3.19 KB
/
release.yml
File metadata and controls
99 lines (86 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
update-homebrew:
needs: release
runs-on: ubuntu-latest
steps:
- name: Update Homebrew formula
env:
GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
VERSION: ${{ github.ref_name }}
run: |
VERSION="${VERSION#v}"
# Download checksums
curl -sL "https://github.com/AgentGuardHQ/shellforge/releases/download/v${VERSION}/checksums.txt" -o checksums.txt
DARWIN_ARM64=$(grep darwin_arm64 checksums.txt | awk '{print $1}')
DARWIN_AMD64=$(grep darwin_amd64 checksums.txt | awk '{print $1}')
LINUX_ARM64=$(grep linux_arm64 checksums.txt | awk '{print $1}')
LINUX_AMD64=$(grep linux_amd64 checksums.txt | awk '{print $1}')
cat > shellforge.rb << FORMULA
# typed: false
# frozen_string_literal: true
class Shellforge < Formula
desc "Local governed agent runtime — wraps Ollama + AgentGuard governance"
homepage "https://github.com/AgentGuardHQ/shellforge"
version "${VERSION}"
license "MIT"
on_macos do
on_arm do
url "https://github.com/AgentGuardHQ/shellforge/releases/download/v${VERSION}/shellforge_${VERSION}_darwin_arm64.tar.gz"
sha256 "${DARWIN_ARM64}"
end
on_intel do
url "https://github.com/AgentGuardHQ/shellforge/releases/download/v${VERSION}/shellforge_${VERSION}_darwin_amd64.tar.gz"
sha256 "${DARWIN_AMD64}"
end
end
on_linux do
on_arm do
url "https://github.com/AgentGuardHQ/shellforge/releases/download/v${VERSION}/shellforge_${VERSION}_linux_arm64.tar.gz"
sha256 "${LINUX_ARM64}"
end
on_intel do
url "https://github.com/AgentGuardHQ/shellforge/releases/download/v${VERSION}/shellforge_${VERSION}_linux_amd64.tar.gz"
sha256 "${LINUX_AMD64}"
end
end
def install
bin.install "shellforge"
end
test do
system "#{bin}/shellforge", "version"
end
end
FORMULA
# Push to homebrew-tap repo
git clone "https://x-access-token:${GH_TOKEN}@github.com/AgentGuardHQ/homebrew-tap.git" tap
mkdir -p tap/Formula
cp shellforge.rb tap/Formula/shellforge.rb
cd tap
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add Formula/shellforge.rb
git commit -m "Update shellforge to ${VERSION}" || echo "No changes"
git push