Skip to content

Commit 33c73f5

Browse files
committed
Merge branch 'deb-packaging' of https://github.com/MoeMahhouk/lighthouse into deb-packaging
2 parents 246a159 + c772026 commit 33c73f5

File tree

2 files changed

+71
-23
lines changed

2 files changed

+71
-23
lines changed

.github/workflows/release.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,24 @@ jobs:
6666
if: env.SELF_HOSTED_RUNNERS == 'false'
6767
run: rustup update stable
6868

69+
# ==============================
70+
# Debian build dependencies
71+
# ==============================
72+
73+
- name: Install Debian build dependencies
74+
if: endsWith(matrix.arch, '-deb')
75+
run: |
76+
sudo apt-get update
77+
sudo apt-get install -y libclang-dev cmake ${{ matrix.gcc_package }}
78+
79+
- name: Install Rust target for Debian builds
80+
if: endsWith(matrix.arch, '-deb')
81+
run: rustup target add ${{ matrix.rust_target }}
82+
83+
- name: Install cargo-deb
84+
if: endsWith(matrix.arch, '-deb')
85+
run: cargo install cargo-deb
86+
6987
# ==============================
7088
# Builds - Binaries
7189
# ==============================
@@ -94,6 +112,38 @@ jobs:
94112
# Builds - Debian Packages
95113
# ==============================
96114

115+
- name: Build reproducible Debian package
116+
if: endsWith(matrix.arch, '-deb')
117+
run: |
118+
make deb-cargo RUST_TARGET=${{ matrix.rust_target }} PROFILE=${{ matrix.profile }}
119+
120+
- name: Find and prepare Debian package
121+
if: endsWith(matrix.arch, '-deb')
122+
run: |
123+
VERSION=${{ needs.extract-version.outputs.VERSION }}
124+
DEB_FILE=$(find target/${{ matrix.rust_target }}/debian -name "*.deb" | head -1)
125+
if [ -n "$DEB_FILE" ]; then
126+
# Create standardized filename to match existing pattern
127+
ARCH_SHORT=$(echo "${{ matrix.rust_target }}" | cut -d'-' -f1)
128+
NEW_NAME="lighthouse-${{ needs.extract-version.outputs.VERSION }}-${ARCH_SHORT}.deb"
129+
cp "$DEB_FILE" "$NEW_NAME"
130+
echo "DEB_PACKAGE=$NEW_NAME" >> $GITHUB_ENV
131+
132+
# Generate checksums
133+
sha256sum "$NEW_NAME" > "$NEW_NAME.sha256"
134+
sha512sum "$NEW_NAME" > "$NEW_NAME.sha512"
135+
136+
echo "Debian package built: $NEW_NAME"
137+
echo "Size: $(du -h "$NEW_NAME" | cut -f1)"
138+
else
139+
echo "❌ No .deb package found"
140+
exit 1
141+
fi
142+
143+
# ==============================
144+
# Builds - Debian Packages
145+
# ==============================
146+
97147
- name: Build reproducible Debian package
98148
if: endsWith(matrix.arch, '-deb')
99149
run: |
@@ -150,6 +200,20 @@ jobs:
150200
# Debian Package Artifacts
151201
# ==============================
152202

203+
- name: Sign Debian package
204+
if: endsWith(matrix.arch, '-deb')
205+
env:
206+
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
207+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
208+
run: |
209+
export GPG_TTY=$(tty)
210+
echo "$GPG_SIGNING_KEY" | gpg --batch --import
211+
echo "$GPG_PASSPHRASE" | gpg --passphrase-fd 0 --pinentry-mode loopback --batch -ab "$DEB_PACKAGE"
212+
213+
# ==============================
214+
# Debian Package Artifacts
215+
# ==============================
216+
153217
- name: Sign Debian package
154218
if: endsWith(matrix.arch, '-deb')
155219
env:

lighthouse/debian/lighthouse.service

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,13 @@ After=network.target
44
Wants=network.target
55

66
[Service]
7-
Type=simple
8-
User=lighthouse
9-
Group=lighthouse
10-
Restart=always
11-
RestartSec=5
12-
TimeoutStopSec=180
13-
Environment="RUST_LOG=info"
14-
ExecStart=/usr/bin/lighthouse \
15-
bn \
16-
--checkpoint-sync-url https://sync-mainnet.beaconcha.in \
17-
--execution-endpoint http://localhost:8551 \
18-
--execution-jwt /etc/jwt.hex \
19-
--suggested-fee-recipient 0x0 \
20-
--always-prepare-payload \
21-
--prepare-payload-lookahead 8000 \
22-
--disable-deposit-contract-sync \
23-
--http \
24-
--port 9000 \
25-
--http-port 3500 \
26-
--metrics \
27-
--metrics-address 127.0.0.1 \
28-
--metrics-port 5054 \
29-
--datadir /mnt/data/lighthouse
7+
Type=exec
8+
DynamicUser=yes
9+
StateDirectory=lighthouse
10+
ExecStart=/usr/bin/lighthouse bn \
11+
--execution-endpoint http://localhost:8551 \
12+
--execution-jwt-secret-key 0000000000000000000000000000000000000000000000000000000000000000
13+
--datadir %S/lighthouse
3014

3115
[Install]
3216
WantedBy=default.target

0 commit comments

Comments
 (0)