Skip to content

Commit

Permalink
Add JetHome package build
Browse files Browse the repository at this point in the history
  • Loading branch information
adeepn committed Jun 10, 2024
1 parent ea4ef82 commit 79a4233
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion .github/workflows/build-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,52 @@ on:
jobs:
build-deb-package:
runs-on: ubuntu-latest
strategy:
matrix:
package: [ "ha", "jethome" ]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Fix scripts
if: matrix.package == 'jethome'
run: |
jh_url="https://haversion.jethome.ru/stable.json"
sed -i "s|URL_VERSION=\"[^\"]*\"|URL_VERSION=\"${jh_url}\"|g" homeassistant-supervised/DEBIAN/postinst
jh_apparmor="https://haversion.jethome.ru/apparmor_stable.txt"
sed -i "s|URL_APPARMOR_PROFILE=\"[^\"]*\"|URL_APPARMOR_PROFILE=\"${jh_apparmor}\"|g" homeassistant-supervised/DEBIAN/postinst
package_name=homeassistant-supervised
sed -i 's|Package: homeassistant-supervised|Package: homeassistant-supervised-jethome|g' homeassistant-supervised/DEBIAN/control
sed -i 's|Description: Home Assistant Supervised|Description: Home Assistant Supervised JetHome|g' homeassistant-supervised/DEBIAN/control
for script_file in homeassistant-supervised/DEBIAN/p*; do
sed -i 's|--package homeassistant-supervised|--package homeassistant-supervised-jh|g' "$script_file"
done
- name: Build Debian Package in Docker
run: |
docker run --rm -v $(pwd):/tmp debian:bullseye-slim bash -c \
"cd /tmp \
&& chmod 555 homeassistant-supervised/DEBIAN/p* \
&& dpkg-deb --build --root-owner-group homeassistant-supervised"
if [[ "${{ matrix.package }}" == "jethome" ]]; then
ls -la
mv homeassistant-supervised.deb homeassistant-supervised-jethome.deb || true
fi
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: homeassistant-supervised.deb
files: homeassistant-supervised*.deb

- name: Rename for deploy
id: getfile
run: |
FILENAME="$(awk '/^Package:/ { print $2 }' homeassistant-supervised/DEBIAN/control)_$(awk '/^Version:/ { print $2 }' homeassistant-supervised/DEBIAN/control)_$(dpkg-architecture -qDEB_BUILD_ARCH).deb"
mv homeassistant-supervised.deb ${FILENAME}
echo "filename=${FILENAME}" >> $GITHUB_OUTPUT
echo "filename=${FILENAME}"
- name: Deploy to server
if: startsWith(github.ref, 'refs/tags/')
uses: jethome-iot/actions/repo-upload@master
with:
SSH_KEY: ${{ secrets.SSH_KEY }}
Expand All @@ -42,6 +65,7 @@ jobs:
branch: stable

- name: Deploy to server
if: startsWith(github.ref, 'refs/tags/')
uses: jethome-iot/actions/repo-upload@master
with:
SSH_KEY: ${{ secrets.SSH_KEY }}
Expand Down

0 comments on commit 79a4233

Please sign in to comment.