-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
163 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Trigger COPR build | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
COPR_HOOK_DAILY: | ||
COPR_HOOK_ALPHA: | ||
COPR_HOOK_BETA: | ||
inputs: | ||
copr_project: | ||
description: COPR project to target | ||
required: true | ||
type: string | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
build-copr-hook: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
ref: ${{ github.ref }} | ||
repository: ${{ github.repository }} | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
pip install requests | ||
- name: Trigger COPR build | ||
shell: python | ||
run: | | ||
import requests | ||
project_name = "${{ inputs.copr_project }}" | ||
hook_secret = "" | ||
project_id = 0 | ||
if project_name == "daily": | ||
hook_secret = "${{ secrets.COPR_HOOK_DAILY }}" | ||
project_id = 160277 | ||
elif project_name == "alpha": | ||
hook_secret = "${{ secrets.COPR_HOOK_ALPHA }}" | ||
project_id = 160278 | ||
elif project_name == "beta": | ||
hook_secret = "${{ secrets.COPR_HOOK_BETA }}" | ||
project_id = 160279 | ||
else: | ||
raise ValueError(f"Unknown COPR project: {project_name}") | ||
webhook_url = f"https://copr.fedorainfracloud.org/webhooks/github/{project_id}/{hook_secret}/meshtasticd/" | ||
copr_payload = { | ||
"event": "push", | ||
"payload": { | ||
"ref": "${{ github.ref }}", | ||
"after": "${{ github.sha }}", | ||
"repository": { | ||
"id": "${{ github.repository_id }}", | ||
"full_name": "${{ github.repository }}", | ||
"git_url": "${{ github.repositoryUrl }}", | ||
"owner": { | ||
"name": "${{ github.repository_owner }}" | ||
} | ||
}, | ||
"pusher": { | ||
"name": "${{ github.actor }}" | ||
}, | ||
"sender": { | ||
"login": "github-actions[bot]" | ||
} | ||
} | ||
} | ||
r = requests.post(webhook_url, json=copr_payload) | ||
r.raise_for_status() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
function meshtastic_version { | ||
meshtastic_version=$(python3 bin/buildinfo.py short) | ||
echo -n "$meshtastic_version" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# meshtasticd spec file for RPM-based distributions | ||
# | ||
# Build locally with: | ||
# ``` | ||
# sudo dnf install rpkg-util | ||
# rpkg local | ||
# ``` | ||
# | ||
# See: | ||
# - https://docs.pagure.org/rpkg-util/v3/index.html | ||
# - https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/ | ||
|
||
Name: meshtasticd | ||
Version: {{{ meshtastic_version }}} | ||
Release: %autorelease | ||
VCS: {{{ git_dir_vcs }}} | ||
Summary: Meshtastic daemon for communicating with Meshtastic devices | ||
|
||
License: GPL-3.0 | ||
URL: https://github.com/meshtastic/firmware | ||
Source0: {{{ git_dir_pack }}} | ||
|
||
BuildRequires: systemd-rpm-macros | ||
BuildRequires: python3-devel | ||
BuildRequires: platformio | ||
BuildRequires: python3dist(protobuf) | ||
BuildRequires: python3dist(grpcio[protobuf]) | ||
BuildRequires: python3dist(grpcio-tools) | ||
BuildRequires: git-core | ||
BuildRequires: gcc-c++ | ||
BuildRequires: pkgconfig(yaml-cpp) | ||
BuildRequires: pkgconfig(libgpiod) | ||
BuildRequires: pkgconfig(bluez) | ||
BuildRequires: pkgconfig(libusb-1.0) | ||
BuildRequires: libi2c-devel | ||
|
||
%description | ||
Meshtastic daemon for controlling Meshtastic devices. Meshtastic is an off-grid | ||
text communication platform that uses inexpensive LoRa radios. | ||
|
||
%prep | ||
{{{ git_dir_setup_macro }}} | ||
|
||
%build | ||
# Use the “native” environment from platformio to build a Linux binary | ||
platformio run -e native | ||
|
||
%install | ||
mkdir -p %{buildroot}%{_sbindir} | ||
install -m 0755 .pio/build/native/program %{buildroot}%{_sbindir}/meshtasticd | ||
|
||
mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd | ||
install -m 0644 bin/config-dist.yaml %{buildroot}%{_sysconfdir}/meshtasticd/config.yaml | ||
mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/config.d | ||
mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/available.d | ||
cp -r bin/config.d/* %{buildroot}%{_sysconfdir}/meshtasticd/available.d | ||
|
||
install -D -m 0644 bin/meshtasticd.service %{buildroot}%{_unitdir}/meshtasticd.service | ||
|
||
%files | ||
%license LICENSE | ||
%doc README.md | ||
%{_sbindir}/meshtasticd | ||
%ghost %config(noreplace) %{_sysconfdir}/meshtasticd/config.yaml | ||
%config %{_sysconfdir}/meshtasticd/available.d/* | ||
%{_unitdir}/meshtasticd.service | ||
|
||
%changelog | ||
{{{ git_dir_changelog }}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[rpkg] | ||
user_macros = "${git_props:root}/bin/rpkg.macros" |