Skip to content

Commit

Permalink
meshtasticd-debian: Fix versioning compliance, add OBS
Browse files Browse the repository at this point in the history
  • Loading branch information
vidplace7 committed Jan 7, 2025
1 parent 9421eba commit 353ad1e
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 7 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build_debian_src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ on:
required: true
inputs:
series:
description: Ubuntu series to target
description: Ubuntu/Debian series to target
required: true
type: string
build_location:
description: Location where build will execute
required: true
type: string

Expand Down Expand Up @@ -47,6 +51,8 @@ jobs:
working-directory: meshtasticd
run: |
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
env:
BUILD_LOCATION: ${{ inputs.build_location }}
id: version

- name: Fetch libdeps, package debian source
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@ jobs:
ppa_repo: daily
series: ${{ matrix.series }}
secrets: inherit

package-obs:
uses: ./.github/workflows/package_obs.yml
with:
repo: empty_for_now
series: unstable
secrets: inherit
72 changes: 72 additions & 0 deletions .github/workflows/package_obs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Package Source Debs

on:
workflow_call:
secrets:
PPA_GPG_PRIVATE_KEY:
required: true
inputs:
repo:
description: Meshtastic OBS repo to target
required: true
type: string
series:
description: Debian 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 }}
build_location: obs

package-obs:
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 OpenSUSE Build Service deps
shell: bash
run: |
echo 'deb http://download.opensuse.org/repositories/openSUSE:/Tools/xUbuntu_24.04/ /' | sudo tee /etc/apt/sources.list.d/openSUSE:Tools.list
curl -fsSL https://download.opensuse.org/repositories/openSUSE:Tools/xUbuntu_24.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/openSUSE_Tools.gpg > /dev/null
sudo apt-get update -y --fix-missing
sudo apt-get install -y osc
- 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
env:
BUILD_LOCATION: obs
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
3 changes: 3 additions & 0 deletions .github/workflows/package_ppa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
secrets: inherit
with:
series: ${{ inputs.series }}
build_location: ppa

package-ppa:
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -55,6 +56,8 @@ jobs:
working-directory: meshtasticd
run: |
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
env:
BUILD_LOCATION: ppa
id: version

- name: Download artifacts
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/release_channels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Trigger release workflows upon Publish

on:
release:
types: [published]
types: [published, released]

permissions: read-all

Expand All @@ -18,3 +18,10 @@ jobs:
${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
series: ${{ matrix.series }}
secrets: inherit

# package-obs:
# uses: ./.github/workflows/package_obs.yml
# with:
# repo: empty_for_now
# series: ${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
# secrets: inherit
7 changes: 4 additions & 3 deletions bin/readprops.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import subprocess
import os
run_number = os.getenv('GITHUB_RUN_NUMBER', '0')
build_location = os.getenv('BUILD_LOCATION', 'local')

def readProps(prefsLoc):
"""Read the version of our project as a string"""
Expand Down Expand Up @@ -30,15 +31,15 @@ def readProps(prefsLoc):
# # short for 'dirty', we want to keep our verstrings source for protobuf reasons
# suffix = sha + "-d"
verObj["long"] = "{}.{}".format(verObj["short"], suffix)
verObj["deb"] = "{}-{}~ppa{}".format(verObj["short"], run_number, sha)
verObj["deb"] = "{}.{}~{}{}".format(verObj["short"], run_number, build_location, sha)
except:
# print("Unexpected error:", sys.exc_info()[0])
# traceback.print_exc()
verObj["long"] = verObj["short"]
verObj["deb"] = "{}-{}~ppa".format(verObj["short"], run_number)
verObj["deb"] = "{}.{}~{}".format(verObj["short"], run_number, build_location)

# print("firmware version " + verStr)
return verObj


# print("path is" + ','.join(sys.path))
# print("path is" + ','.join(sys.path))
2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
meshtasticd (2.5.19) UNRELEASED; urgency=medium
meshtasticd (2.5.19.0) UNRELEASED; urgency=medium

* Initial packaging

Expand Down
2 changes: 1 addition & 1 deletion debian/ci_changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
export DEBEMAIL="github-actions[bot]@users.noreply.github.com"
PKG_VERSION=$(python3 bin/buildinfo.py short)

dch --newversion "$PKG_VERSION-1" \
dch --newversion "$PKG_VERSION.0" \
--distribution UNRELEASED \
"GitHub Actions Automatic version bump"

0 comments on commit 353ad1e

Please sign in to comment.