From 2cc5598f8992074d7ebf5602719d174473afb525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 5 Jun 2024 16:27:46 +0200 Subject: [PATCH] Try building a deb for native --- .github/workflows/package_amd64.yml | 78 +++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/package_amd64.yml diff --git a/.github/workflows/package_amd64.yml b/.github/workflows/package_amd64.yml new file mode 100644 index 000000000..ae7bf3242 --- /dev/null +++ b/.github/workflows/package_amd64.yml @@ -0,0 +1,78 @@ +name: Package Native + +on: + workflow_call: + workflow_dispatch: + +permissions: + contents: write + packages: write + +jobs: + build-native: + uses: ./.github/workflows/build_native.yml + + package-native: + runs-on: ubuntu-latest + needs: build-native + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + + - name: Pull web ui + uses: dsaltares/fetch-gh-release-asset@master + with: + repo: meshtastic/web + file: build.tar + target: build.tar + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Get release version string + run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + name: firmware-native-${{ steps.version.outputs.version }}.zip + merge-multiple: true + + - name: Display structure of downloaded files + run: ls -R + + - name: build .debpkg + run: | + mkdir -p .debpkg/DEBIAN + mkdir -p .debpkg/usr/share/doc/meshtasticd/web + mkdir -p .debpkg/usr/sbin + mkdir -p .debpkg/etc/meshtasticd + mkdir -p .debpkg/usr/lib/systemd/system/ + tar -xf build.tar -C .debpkg/usr/share/doc/meshtasticd/web + gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz + cp release/meshtasticd_linux_x86_64 .debpkg/usr/sbin/meshtasticd + cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml + chmod +x .debpkg/usr/sbin/meshtasticd + cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service + echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles + chmod +x .debpkg/DEBIAN/conffiles + + - uses: jiro4989/build-deb-action@v3 + with: + package: meshtasticd + package_root: .debpkg + maintainer: Jonathan Bennett + version: ${{ steps.version.outputs.version }} # refs/tags/v*.*.* + arch: amd64 + depends: libyaml-cpp0.7, openssl, libulfius2.7 + desc: Native Linux Meshtastic binary. + + - uses: actions/upload-artifact@v4 + with: + name: meshtasticd_${{ steps.version.outputs.version }}_amd64.deb + overwrite: true + path: | + ./*.deb