firmware/.github/workflows/package_raspbian.yml

91 lines
3.3 KiB
YAML
Raw Normal View History

2023-11-19 20:30:34 +00:00
name: Package Raspbian
on:
workflow_call:
workflow_dispatch:
2023-11-19 20:30:34 +00:00
permissions:
contents: write
packages: write
jobs:
2023-11-19 21:48:43 +00:00
build-raspbian:
uses: ./.github/workflows/build_raspbian.yml
2023-11-19 22:53:00 +00:00
2023-11-19 20:30:34 +00:00
package-raspbian:
runs-on: ubuntu-22.04
2023-11-19 21:48:43 +00:00
needs: build-raspbian
2023-11-19 20:30:34 +00:00
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
2023-11-20 02:28:37 +00:00
submodules: recursive
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
2023-11-19 22:53:00 +00:00
2024-03-06 23:00:23 +00:00
- name: Pull web ui
uses: dsaltares/fetch-gh-release-asset@master
2024-03-06 23:00:23 +00:00
with:
repo: meshtastic/web
file: build.tar
target: build.tar
token: ${{ secrets.GITHUB_TOKEN }}
2023-11-19 21:48:43 +00:00
- name: Get release version string
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
2023-11-19 21:48:43 +00:00
id: version
- name: Download artifacts
uses: actions/download-artifact@v4
2023-11-19 21:48:43 +00:00
with:
name: firmware-raspbian-${{ steps.version.outputs.long }}.zip
merge-multiple: true
2023-11-19 21:48:43 +00:00
- name: Display structure of downloaded files
run: ls -R
2023-11-19 22:53:00 +00:00
2023-11-19 20:30:34 +00:00
- name: build .debpkg
run: |
2024-05-17 08:32:11 +00:00
mkdir -p .debpkg/DEBIAN
mkdir -p .debpkg/usr/share/meshtasticd/web
2023-11-19 20:30:34 +00:00
mkdir -p .debpkg/usr/sbin
mkdir -p .debpkg/etc/meshtasticd
mkdir -p .debpkg/etc/meshtasticd/config.d
mkdir -p .debpkg/etc/meshtasticd/available.d
2023-11-19 20:30:34 +00:00
mkdir -p .debpkg/usr/lib/systemd/system/
tar -xf build.tar -C .debpkg/usr/share/meshtasticd/web
shopt -s dotglob nullglob
if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then mv .debpkg/usr/share/meshtasticd/web/build/* .debpkg/usr/share/meshtasticd/web/; fi
if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/meshtasticd/web/build; fi
if [ -d .debpkg/usr/share/meshtasticd/web/.DS_Store ]; then rm -f .debpkg/usr/share/meshtasticd/web/.DS_Store; fi
gunzip .debpkg/usr/share/meshtasticd/web/ -r
cp release/meshtasticd_linux_aarch64 .debpkg/usr/sbin/meshtasticd
2023-11-19 21:48:43 +00:00
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/ -r
2023-11-19 20:30:34 +00:00
chmod +x .debpkg/usr/sbin/meshtasticd
2023-11-19 21:48:43 +00:00
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
2024-05-17 08:32:11 +00:00
echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles
chmod +x .debpkg/DEBIAN/conffiles
# Transition /usr/share/doc/meshtasticd to /usr/share/meshtasticd
echo "rm -rf /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/preinst
chmod +x .debpkg/DEBIAN/preinst
echo "ln -sf /usr/share/meshtasticd /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/postinst
chmod +x .debpkg/DEBIAN/postinst
2023-11-19 20:30:34 +00:00
- uses: jiro4989/build-deb-action@v3
with:
package: meshtasticd
package_root: .debpkg
maintainer: Jonathan Bennett
version: ${{ steps.version.outputs.long }} # refs/tags/v*.*.*
2023-11-19 20:30:34 +00:00
arch: arm64
depends: libyaml-cpp0.7, openssl, libulfius2.7, libi2c0
2023-11-19 20:30:34 +00:00
desc: Native Linux Meshtastic binary.
- uses: actions/upload-artifact@v4
with:
name: meshtasticd_${{ steps.version.outputs.long }}_arm64.deb
overwrite: true
path: |
./*.deb