forked from home-assistant/supervised-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }} | ||
|
@@ -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 }} | ||
|