Skip to content

Commit dbb2eda

Browse files
LauJosefsenclaude
andcommitted
Add APT and Homebrew publishing to release workflow
- APT: build amd64 and arm64 .deb packages, generate signed APT repo index, and rsync to gitte-ppa.cego.dk - Homebrew: rewrite Formula/gitte.rb in cego/homebrew-tap with correct version and sha256 hashes for each platform on every release - README: document brew, apt, and binary install methods Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7fea6b0 commit dbb2eda

2 files changed

Lines changed: 120 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,105 @@ jobs:
4747
gh release upload "${GITHUB_REF_NAME}" bin/gitte-*.tar.gz bin/gitte-*.zip --clobber
4848
env:
4949
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Publish to APT (gitte-ppa.cego.dk)
52+
if: github.ref_type == 'tag'
53+
env:
54+
VERSION: ${{ github.ref_name }}
55+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
56+
PPA_SSH_KEY: ${{ secrets.PPA_SSH_KEY }}
57+
run: |
58+
sudo apt-get install -y dpkg-dev apt-utils
59+
60+
echo "${GPG_PRIVATE_KEY}" | gpg --batch --import
61+
62+
DESCRIPTION="Developer environment orchestration tool"
63+
64+
for ARCH in amd64 arm64; do
65+
SRCBIN="bin/linux-${ARCH}/gitte"
66+
PKGDIR="pkg/gitte_${VERSION}_${ARCH}"
67+
mkdir -p "${PKGDIR}/DEBIAN" "${PKGDIR}/usr/local/bin"
68+
cat > "${PKGDIR}/DEBIAN/control" << EOF
69+
Name: gitte
70+
Package: gitte
71+
Version: ${VERSION}
72+
Architecture: ${ARCH}
73+
Author: Cego A/S <noc+gitte@cego.dk>
74+
Maintainer: Cego A/S <noc+gitte@cego.dk>
75+
Description: ${DESCRIPTION}
76+
Homepage: https://github.com/cego/gitte
77+
Website: https://github.com/cego/gitte
78+
EOF
79+
cp "${SRCBIN}" "${PKGDIR}/usr/local/bin/"
80+
dpkg-deb --root-owner-group --build "${PKGDIR}" ppa/
81+
done
82+
83+
(cd ppa && dpkg-scanpackages --multiversion . > Packages)
84+
(cd ppa && gzip -k -f Packages)
85+
(cd ppa && apt-ftparchive release . > Release)
86+
(cd ppa && gpg --default-key "noc+gitte@cego.dk" -abs -o - Release > Release.gpg)
87+
(cd ppa && gpg --default-key "noc+gitte@cego.dk" --clearsign -o - Release > InRelease)
88+
89+
echo "${PPA_SSH_KEY}" > /tmp/ppa_key
90+
chmod 600 /tmp/ppa_key
91+
rsync -az -e "ssh -i /tmp/ppa_key -o StrictHostKeyChecking=no" \
92+
ppa/ deploy@gitte-ppa.cego.dk:/var/www/ppa/
93+
rm /tmp/ppa_key
94+
95+
- name: Update Homebrew tap
96+
if: github.ref_type == 'tag'
97+
env:
98+
VERSION: ${{ github.ref_name }}
99+
TAP_TOKEN: ${{ secrets.TAP_TOKEN }}
100+
run: |
101+
SHA_DARWIN_AMD64=$(sha256sum bin/gitte-darwin-amd64.tar.gz | awk '{print $1}')
102+
SHA_DARWIN_ARM64=$(sha256sum bin/gitte-darwin-arm64.tar.gz | awk '{print $1}')
103+
SHA_LINUX_AMD64=$(sha256sum bin/gitte-linux-amd64.tar.gz | awk '{print $1}')
104+
SHA_LINUX_ARM64=$(sha256sum bin/gitte-linux-arm64.tar.gz | awk '{print $1}')
105+
106+
git clone "https://x-access-token:${TAP_TOKEN}@github.com/cego/homebrew-tap.git" tap
107+
cd tap
108+
mkdir -p Formula
109+
110+
cat > Formula/gitte.rb << EOF
111+
class Gitte < Formula
112+
desc "Developer environment orchestration tool"
113+
homepage "https://github.com/cego/gitte"
114+
version "${VERSION}"
115+
license "MIT"
116+
117+
on_macos do
118+
if Hardware::CPU.arm?
119+
url "https://github.com/cego/gitte/releases/download/${VERSION}/gitte-darwin-arm64.tar.gz"
120+
sha256 "${SHA_DARWIN_ARM64}"
121+
else
122+
url "https://github.com/cego/gitte/releases/download/${VERSION}/gitte-darwin-amd64.tar.gz"
123+
sha256 "${SHA_DARWIN_AMD64}"
124+
end
125+
end
126+
127+
on_linux do
128+
if Hardware::CPU.arm?
129+
url "https://github.com/cego/gitte/releases/download/${VERSION}/gitte-linux-arm64.tar.gz"
130+
sha256 "${SHA_LINUX_ARM64}"
131+
else
132+
url "https://github.com/cego/gitte/releases/download/${VERSION}/gitte-linux-amd64.tar.gz"
133+
sha256 "${SHA_LINUX_AMD64}"
134+
end
135+
end
136+
137+
def install
138+
bin.install "gitte"
139+
end
140+
141+
test do
142+
system "#{bin}/gitte", "--version"
143+
end
144+
end
145+
EOF
146+
147+
git config user.email "noc+gitte@cego.dk"
148+
git config user.name "CI"
149+
git add Formula/gitte.rb
150+
git commit -m "gitte ${VERSION}"
151+
git push

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,24 @@ Gitte is a developer environment orchestration tool for teams working across man
1717

1818
## Installation
1919

20+
### Homebrew (macOS and Linux)
21+
22+
```bash
23+
brew tap cego/tap
24+
brew install gitte
25+
```
26+
27+
### APT (Debian and Ubuntu)
28+
29+
```bash
30+
curl -fsSL https://gitte-ppa.cego.dk/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/gitte.gpg
31+
echo "deb [signed-by=/etc/apt/keyrings/gitte.gpg] https://gitte-ppa.cego.dk ./" | sudo tee /etc/apt/sources.list.d/gitte.list
32+
sudo apt update
33+
sudo apt install gitte
34+
```
35+
36+
### Binary download
37+
2038
Download the latest binary from the [releases page](https://github.com/cego/gitte/releases) and place it on your `PATH`.
2139

2240
### Build from source

0 commit comments

Comments
 (0)