tweaks + automatic packaging
Some checks failed
Build .deb on release / Build-Deb (push) Failing after 49s

This commit is contained in:
Alex Janka 2024-06-02 11:43:05 +10:00
parent 41c9cdafaf
commit 571010c07c
5 changed files with 31 additions and 21 deletions

28
.gitea/workflows/deb.yaml Normal file
View file

@ -0,0 +1,28 @@
name: Build .deb on release
run-name: Building .deb of latest release and adding to apt repo
on:
push:
tags:
- "*"
jobs:
Build-Deb:
runs-on: aarch64
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Build
run: "cargo build --release --target=aarch64-unknown-linux-gnu"
- name: Build .deb
run: "cargo deb --target=aarch64-unknown-linux-gnu"
- name: Add .deb to apt repository
run: "curl --user alex:${{ secrets.PACKAGING_TOKEN }} --upload-file $(ls -t ./target/aarch64-unknown-linux-gnu/debian/*.deb | head -1) https://git.alexjanka.com/api/packages/alex/debian/pool/testing/main/upload"
- name: "Release package"
id: use-go-action
uses: https://gitea.com/actions/release-action@main
with:
files: |-
./target/aarch64-unknown-linux-gnu/debian/*.deb
./target/aarch64-unknown-linux-gnu/release/homekit-exporter
api_key: "${{secrets.PACKAGING_TOKEN}}"

2
Cargo.lock generated
View file

@ -1155,7 +1155,7 @@ dependencies = [
[[package]] [[package]]
name = "homekit-controller" name = "homekit-controller"
version = "0.6.4" version = "0.6.5"
dependencies = [ dependencies = [
"chacha20poly1305", "chacha20poly1305",
"ed25519-dalek", "ed25519-dalek",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "homekit-controller" name = "homekit-controller"
version = "0.6.4" version = "0.6.5"
edition = "2021" edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
description = "Partial implementation of the HomeKit controller protocol" description = "Partial implementation of the HomeKit controller protocol"

View file

@ -438,24 +438,6 @@ pub enum HomekitError {
NoData, NoData,
} }
trait FlattenResult {
type T;
type E;
fn flatten_result(self) -> Result<Self::T, Self::E>;
}
impl<T, E> FlattenResult for Result<Result<T, E>, E> {
type T = T;
type E = E;
fn flatten_result(self) -> Result<Self::T, Self::E> {
match self {
Ok(v) => v,
Err(e) => Err(e),
}
}
}
#[derive(Debug, Error)] #[derive(Debug, Error)]
pub enum ConnectionError { pub enum ConnectionError {
#[error("http")] #[error("http")]

View file

@ -158,7 +158,7 @@ pub struct ServiceCharacteristic {
impl ServiceCharacteristic { impl ServiceCharacteristic {
pub fn update_from(&mut self, other: &ServiceCharacteristic) { pub fn update_from(&mut self, other: &ServiceCharacteristic) {
self.value = other.value.clone(); self.value.clone_from(&other.value);
if other.event_notifications_enabled.is_some() { if other.event_notifications_enabled.is_some() {
self.event_notifications_enabled = other.event_notifications_enabled; self.event_notifications_enabled = other.event_notifications_enabled;
} }