feat: add Debian package support to automated releases
- Added Debian package building to GitHub Actions workflow - Fixed debian/rules for proper cross-compilation and native builds - Export environment variables in build-deb.sh for dpkg-buildpackage - Updated release description with Debian package installation instructions - Tested successful .deb package creation locally - Package includes systemd services, configs, and automatic setup - Version bump to 1.1.7 for enhanced release automation
This commit is contained in:
@@ -84,6 +84,24 @@ jobs:
|
||||
cd releases
|
||||
sha256sum * > SHA256SUMS
|
||||
ls -la
|
||||
|
||||
- name: Build Debian Package
|
||||
run: |
|
||||
# Install Debian package building tools
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y dpkg-dev debhelper dh-make fakeroot
|
||||
|
||||
# Build the Debian package using our existing build script
|
||||
chmod +x build-deb.sh
|
||||
./build-deb.sh
|
||||
|
||||
# Copy the .deb file to releases directory
|
||||
find . -name "*.deb" -exec cp {} releases/ \;
|
||||
|
||||
# Update checksums to include .deb file
|
||||
cd releases
|
||||
sha256sum *.deb >> SHA256SUMS
|
||||
ls -la
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
@@ -95,6 +113,16 @@ jobs:
|
||||
|
||||
## 📦 Installation
|
||||
|
||||
### Debian Package Installation (Recommended)
|
||||
```bash
|
||||
# Download and install the .deb package
|
||||
wget https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.version }}/ddns-updater_${{ steps.version.outputs.version_name }}_amd64.deb
|
||||
sudo dpkg -i ddns-updater_${{ steps.version.outputs.version_name }}_amd64.deb
|
||||
|
||||
# Fix any dependency issues if needed
|
||||
sudo apt-get install -f
|
||||
```
|
||||
|
||||
### Binary Installation
|
||||
```bash
|
||||
# For x86_64 (Intel/AMD 64-bit)
|
||||
|
||||
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [1.1.7] - 2025-01-03
|
||||
|
||||
### Added
|
||||
- **Debian Package**: Automated release now builds and includes .deb package
|
||||
- Added Debian package building to GitHub Actions workflow
|
||||
- Includes systemd services, configuration files, and proper dependencies
|
||||
- Easy installation with `sudo dpkg -i ddns-updater_*.deb`
|
||||
- Automatic user/group creation and service setup
|
||||
|
||||
### Changed
|
||||
- **Release Process**: Enhanced automated release with Debian package support
|
||||
- **Installation**: Updated release notes with Debian package installation instructions
|
||||
|
||||
## [1.1.6] - 2025-01-03
|
||||
|
||||
### Security
|
||||
|
||||
Generated
+1
-1
@@ -291,7 +291,7 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
|
||||
|
||||
[[package]]
|
||||
name = "ddns_updater"
|
||||
version = "1.1.6"
|
||||
version = "1.1.7"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"chrono",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ddns_updater"
|
||||
version = "1.1.6"
|
||||
version = "1.1.7"
|
||||
edition = "2021" # Use 2021 edition for better compatibility
|
||||
default-run = "ddns_updater"
|
||||
rust-version = "1.82" # Specify minimum Rust version for Debian 12
|
||||
|
||||
+3
-3
@@ -78,9 +78,9 @@ rm -rf ../ddns-updater_* || true
|
||||
print_status "Building Rust binary..."
|
||||
|
||||
# Support cross-compilation if environment variables are set
|
||||
CARGO_TARGET=${CARGO_TARGET:-"x86_64-unknown-linux-gnu"}
|
||||
USE_CROSS=${USE_CROSS:-"false"}
|
||||
DEB_HOST_ARCH=${DEB_HOST_ARCH:-"amd64"}
|
||||
export CARGO_TARGET=${CARGO_TARGET:-"x86_64-unknown-linux-gnu"}
|
||||
export USE_CROSS=${USE_CROSS:-"false"}
|
||||
export DEB_HOST_ARCH=${DEB_HOST_ARCH:-"amd64"}
|
||||
|
||||
print_status "Build Configuration:"
|
||||
print_status " CARGO_TARGET: $CARGO_TARGET"
|
||||
|
||||
Vendored
+11
-4
@@ -9,9 +9,12 @@ override_dh_auto_build:
|
||||
@if [ "$(USE_CROSS)" = "true" ]; then \
|
||||
echo "Using cross-compilation..."; \
|
||||
cross build --release --target $(CARGO_TARGET); \
|
||||
elif [ -n "$(CARGO_TARGET)" ]; then \
|
||||
echo "Using native compilation with target..."; \
|
||||
cargo build --release --target $(CARGO_TARGET); \
|
||||
else \
|
||||
echo "Using native compilation..."; \
|
||||
cargo build --release --target $(CARGO_TARGET); \
|
||||
cargo build --release; \
|
||||
fi
|
||||
|
||||
override_dh_strip:
|
||||
@@ -41,13 +44,17 @@ override_dh_shlibdeps:
|
||||
|
||||
override_dh_auto_install:
|
||||
# Install the main binary (use correct path for cross-compilation)
|
||||
@BINARY_PATH="target/$(CARGO_TARGET)/release/ddns_updater"; \
|
||||
@if [ -n "$(CARGO_TARGET)" ]; then \
|
||||
BINARY_PATH="target/$(CARGO_TARGET)/release/ddns_updater"; \
|
||||
else \
|
||||
BINARY_PATH="target/release/ddns_updater"; \
|
||||
fi; \
|
||||
if [ -f "$$BINARY_PATH" ]; then \
|
||||
echo "Installing binary from $$BINARY_PATH"; \
|
||||
install -D -m 755 "$$BINARY_PATH" debian/ddns-updater/usr/bin/ddns-updater; \
|
||||
else \
|
||||
echo "Binary not found at $$BINARY_PATH, trying default path..."; \
|
||||
install -D -m 755 target/release/ddns_updater debian/ddns-updater/usr/bin/ddns-updater; \
|
||||
echo "Binary not found at $$BINARY_PATH"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
# Install systemd service files
|
||||
|
||||
Reference in New Issue
Block a user