Skip to content

Commit

Permalink
Merge branch 'master' into NextHopRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
GUVWAF authored Jan 7, 2025
2 parents 919660e + 9421eba commit 5154e29
Show file tree
Hide file tree
Showing 38 changed files with 1,256 additions and 94 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/build_debian_src.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build Debian Source Package

on:
workflow_call:
secrets:
PPA_GPG_PRIVATE_KEY:
required: true
inputs:
series:
description: Ubuntu series to target
required: true
type: string

permissions:
contents: write
packages: write

jobs:
build-debian-src:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
path: meshtasticd
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Install deps
shell: bash
working-directory: meshtasticd
run: |
sudo apt-get update -y --fix-missing
sudo apt-get install -y software-properties-common build-essential devscripts equivs
sudo add-apt-repository ppa:meshtastic/build-tools -y
sudo apt-get update -y --fix-missing
sudo mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
id: gpg

- name: Get release version string
working-directory: meshtasticd
run: |
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
id: version

- name: Fetch libdeps, package debian source
working-directory: meshtasticd
run: debian/ci_pack_sdeb.sh
env:
SERIES: ${{ inputs.series }}
GPG_KEY_ID: ${{ steps.gpg.outputs.keyid }}
PKG_VERSION: ${{ steps.version.outputs.deb }}

- name: Store binaries as an artifact
uses: actions/upload-artifact@v4
with:
name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src
overwrite: true
path: |
meshtasticd_${{ steps.version.outputs.deb }}*
5 changes: 5 additions & 0 deletions .github/workflows/main_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,17 @@ jobs:
run: >-
bin/bump_version.py
- name: Update debian changelog
run: >-
debian/ci_changelog.sh
- name: Create version.properties pull request
uses: peter-evans/create-pull-request@v7
with:
title: Bump version.properties
add-paths: |
version.properties
debian/changelog
release-firmware:
strategy:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,13 @@ jobs:
uses: trunk-io/trunk-action@782e83f803ca6e369f035d64c6ba2768174ba61b
with:
trunk-token: ${{ secrets.TRUNK_TOKEN }}
package-ppa:
strategy:
fail-fast: false
matrix:
series: [plucky, oracular, noble, jammy]
uses: ./.github/workflows/package_ppa.yml
with:
ppa_repo: daily
series: ${{ matrix.series }}
secrets: inherit
72 changes: 72 additions & 0 deletions .github/workflows/package_ppa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Package Launchpad PPA

on:
workflow_call:
secrets:
PPA_GPG_PRIVATE_KEY:
required: true
inputs:
ppa_repo:
description: Meshtastic PPA to target
required: true
type: string
series:
description: Ubuntu series to target
required: true
type: string
workflow_dispatch:

permissions:
contents: write
packages: write

jobs:
build-debian-src:
uses: ./.github/workflows/build_debian_src.yml
secrets: inherit
with:
series: ${{ inputs.series }}

package-ppa:
runs-on: ubuntu-24.04
needs: build-debian-src
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
path: meshtasticd
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Install deps
shell: bash
run: |
sudo apt-get update -y --fix-missing
sudo apt-get install -y dput
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
id: gpg

- name: Get release version string
working-directory: meshtasticd
run: |
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
id: version

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src
merge-multiple: true

- name: Display structure of downloaded files
run: ls -lah

- name: Publish with dput
if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
run: |
dput ppa:meshtastic/${{ inputs.ppa_repo }} meshtasticd_${{ steps.version.outputs.deb }}~${{ inputs.series }}_source.changes
20 changes: 20 additions & 0 deletions .github/workflows/release_channels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Trigger release workflows upon Publish

on:
release:
types: [published]

permissions: read-all

jobs:
package-ppa:
strategy:
fail-fast: false
matrix:
series: [plucky, oracular, noble, jammy]
uses: ./.github/workflows/package_ppa.yml
with:
ppa_repo: |-
${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
series: ${{ matrix.series }}
secrets: inherit
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.pio
pio
pio.tar
web
web.tar

# ignore vscode IDE settings files
.vscode/*
Expand Down Expand Up @@ -30,4 +34,4 @@ release/
.vscode/extensions.json
/compile_commands.json
src/mesh/raspihttp/certificate.pem
src/mesh/raspihttp/private_key.pem
src/mesh/raspihttp/private_key.pem
6 changes: 3 additions & 3 deletions arch/rp2xx0/rp2350.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ platform_packages = framework-arduinopico@https://github.com/earlephilhower/ardu
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m
build_flags =
${arduino_base.build_flags} -Wno-unused-variable
${arduino_base.build_flags} -Wno-unused-variable -Wcast-align
-Isrc/platform/rp2xx0
-D__PLAT_RP2040__
-D__PLAT_RP2350__
# -D _POSIX_THREADS
build_src_filter =
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<modules/esp32> -<platform/nrf52/> -<platform/stm32wl> -<mesh/eth/> -<mesh/wifi/> -<mesh/http/> -<mesh/raspihttp>
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<modules/esp32> -<platform/nrf52/> -<platform/stm32wl> -<mesh/eth/> -<mesh/wifi/> -<mesh/http/> -<mesh/raspihttp> -<platform/rp2xx0/pico_sleep> -<platform/rp2xx0/hardware_rosc>

lib_ignore =
BluetoothOTA
Expand Down
1 change: 1 addition & 0 deletions bin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config.yaml
6 changes: 0 additions & 6 deletions bin/config-dist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ Lora:
# IRQ: 17
# Reset: 22

# Module: RF95 # Adafruit RFM9x
# Reset: 25
# CS: 7
# IRQ: 22
# Busy: 23

# Module: RF95 # Elecrow Lora RFM95 IOT https://www.elecrow.com/lora-rfm95-iot-board-for-rpi.html
# Reset: 22
# CS: 7
Expand Down
5 changes: 5 additions & 0 deletions bin/config.d/lora-Adafruit-RFM9x
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Module: RF95 # Adafruit RFM9x
# Reset: 25
# CS: 7
# IRQ: 22
# Busy: 23
10 changes: 6 additions & 4 deletions bin/readprops.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import configparser
import subprocess

import os
run_number = os.getenv('GITHUB_RUN_NUMBER', '0')

def readProps(prefsLoc):
"""Read the version of our project as a string"""
Expand All @@ -10,6 +11,7 @@ def readProps(prefsLoc):
version = dict(config.items("VERSION"))
verObj = dict(
short="{}.{}.{}".format(version["major"], version["minor"], version["build"]),
deb="unset",
long="unset",
)

Expand All @@ -27,13 +29,13 @@ def readProps(prefsLoc):
# if isDirty:
# # short for 'dirty', we want to keep our verstrings source for protobuf reasons
# suffix = sha + "-d"
verObj["long"] = "{}.{}.{}.{}".format(
version["major"], version["minor"], version["build"], suffix
)
verObj["long"] = "{}.{}".format(verObj["short"], suffix)
verObj["deb"] = "{}-{}~ppa{}".format(verObj["short"], run_number, sha)
except:
# print("Unexpected error:", sys.exc_info()[0])
# traceback.print_exc()
verObj["long"] = verObj["short"]
verObj["deb"] = "{}-{}~ppa".format(verObj["short"], run_number)

# print("firmware version " + verStr)
return verObj
Expand Down
6 changes: 6 additions & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.debhelper
debhelper-build-stamp
meshtasticd
files
meshtasticd.substvars
meshtasticd.postrm.debhelper
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
meshtasticd (2.5.19) UNRELEASED; urgency=medium

* Initial packaging

-- Austin Lane <[email protected]> Thu, 02 Jan 2025 12:00:00 +0000
7 changes: 7 additions & 0 deletions debian/ci_changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/bash
export DEBEMAIL="github-actions[bot]@users.noreply.github.com"
PKG_VERSION=$(python3 bin/buildinfo.py short)

dch --newversion "$PKG_VERSION-1" \
--distribution UNRELEASED \
"GitHub Actions Automatic version bump"
23 changes: 23 additions & 0 deletions debian/ci_pack_sdeb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/bash
export DEBEMAIL="[email protected]"
export PLATFORMIO_LIBDEPS_DIR=pio/libdeps
export PLATFORMIO_PACKAGES_DIR=pio/packages
export PLATFORMIO_CORE_DIR=pio/core

# Download libraries to `pio`
platformio pkg install -e native
platformio pkg install -e native -t platformio/[email protected]
# Compress `pio` directory to prevent dh_clean from sanitizing it
tar -cf pio.tar pio/
rm -rf pio
# Download the latest meshtastic/web release build.tar to `web.tar`
curl -L https://github.com/meshtastic/web/releases/download/latest/build.tar -o web.tar

package=$(dpkg-parsechangelog --show-field Source)

rm -rf debian/changelog
dch --create --distribution "$SERIES" --package "$package" --newversion "$PKG_VERSION~$SERIES" \
"GitHub Actions Automatic packaging for $PKG_VERSION~$SERIES"

# Build the source deb
debuild -S -nc -k"$GPG_KEY_ID"
32 changes: 32 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Source: meshtasticd
Section: misc
Priority: optional
Maintainer: Austin Lane <[email protected]>
Build-Depends: debhelper-compat (= 13),
tar,
gzip,
platformio,
python3-protobuf,
python3-grpcio,
git,
g++,
pkg-config,
libyaml-cpp-dev,
libgpiod-dev,
libbluetooth-dev,
libusb-1.0-0-dev,
libi2c-dev,
openssl,
libssl-dev,
libulfius-dev,
liborcania-dev
Standards-Version: 4.6.2
Homepage: https://github.com/meshtastic/firmware
Rules-Requires-Root: no

Package: meshtasticd
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: Meshtastic daemon for communicating with Meshtastic devices
Meshtastic is an off-grid text communication platform that uses inexpensive
LoRa radios.
4 changes: 4 additions & 0 deletions debian/meshtasticd.dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
etc/meshtasticd
etc/meshtasticd/config.d
etc/meshtasticd/available.d
usr/share/meshtasticd/web
8 changes: 8 additions & 0 deletions debian/meshtasticd.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.pio/build/native/meshtasticd usr/sbin

bin/config.yaml etc/meshtasticd
bin/config.d/* etc/meshtasticd/available.d

bin/meshtasticd.service lib/systemd/system

web/* usr/share/meshtasticd/web
Loading

0 comments on commit 5154e29

Please sign in to comment.