Skip to content

Commit

Permalink
Merge pull request #39 from YIO-Remote/develop
Browse files Browse the repository at this point in the history
EOL develop branch and automated release preparations
  • Loading branch information
zehnm authored May 3, 2020
2 parents 1ac5d57 + ae06a22 commit 585d302
Show file tree
Hide file tree
Showing 79 changed files with 512 additions and 2,538 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# GitHub Action for creating simple (pre-)releases of the YIO remote-os.
# There are no Buildroot builds involved since they are taking too long for the
# GitHub runners. (This might be added later with external infrastructure).
# - Creates a pre-release if pushed on master branch without a version tag.
# - Creates a release if pushed on master branch with a version tag.
---
name: "Release"

on:
push:
branches:
- master
tags:
- v[0-9]+.[0-9]+.[0-9]+

env:
APP_NAME: app
PROJECT_NAME: remote-os

jobs:
release:
name: Create Release
if: github.ref == 'refs/heads/master' || contains(github.ref, 'tags/v')
runs-on: ubuntu-latest

steps:
- name: Checkout ${{ env.PROJECT_NAME}}
uses: actions/checkout@v2
with:
# History of 500 should be more than enough to calculate commit count since last release tag.
fetch-depth: 500
path: ${{ env.PROJECT_NAME}}

- name: Fetch all tags to determine version
run: |
cd ${{ env.PROJECT_NAME}}
git fetch origin +refs/tags/*:refs/tags/*
git describe --match "v[0-9]*" --tags HEAD --always
- name: Get artifact version
run: |
cd ${{ env.PROJECT_NAME}}
APP_VERSION=$(git describe --match "v[0-9]*" --tags HEAD --always)
echo "::set-env name=APP_VERSION::$APP_VERSION"
echo "::set-env name=TIMESTAMP::$(date +"%Y%m%d_%H%M%S")"
- name: Create Pre-Release ${{ env.APP_VERSION }}
uses: "marvinpinto/action-automatic-releases@latest"
if: "!contains(github.ref, 'tags/v')"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build ${{ env.APP_VERSION }}"
# No files yet, added manually for now
#files: |
# *.tar

- name: Create Release ${{ env.APP_VERSION }}
uses: "marvinpinto/action-automatic-releases@latest"
if: "contains(github.ref, 'tags/v')"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
# No files yet, added manually for now
#files: |
# *.tar
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,7 @@ Checkout project and build full cross compiler toolchain incl. target system:
mkdir -p $SRC_DIR
cd $SRC_DIR
git clone https://github.com/YIO-Remote/remote-os.git

# switch to development branch
cd remote-os
git checkout develop

# build full toolchain without YIO remote SD card image
make SKIP_BUILD_IMAGE=y

Expand All @@ -108,7 +104,13 @@ The `make` command will automatically initialize the buildroot Git submodule (`g
#### Build SD Card Image

The SD card image build requires at least a YIO remote configuration file in `./rpi0/boot/config.json`. The latest version can be found in the [remote-software](https://github.com/YIO-Remote/remote-software) repository.
Furthermore all application binaries and resources have to be put in `./overlay/usr/bin/yio-remote/`. These are the remote-software binary, integration plugins, fonts, icons, images and the web-configurator. See [build script in the Docker image](docker/yio-image/scripts/yio.sh) for a quick and dirty approach until each component will be properly released.
Furthermore all application binaries and resources have to be put in the appropriate sub-folders of `./overlay/opt/yio/`. These are:

- `app`: the remote-software binary and resources (fonts, icons, images, json schemas)
- `app-plugins`: the integration plugins
- `web-configurator`: the web-configurator project

See [build script in the Docker image](docker/yio-image/scripts/yio.sh) for a quick and dirty approach until each component will be properly released.

Once all resources are in place the build is a simple command:

Expand Down
4 changes: 2 additions & 2 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ Build all:

yio build

Switch Git branch of remote-software project to develop:
Switch Git branch of remote-software project to a feature branch:

yio remote-software git checkout develop
yio remote-software git checkout feature/foobar

See Git status of remote-os project:

Expand Down
36 changes: 18 additions & 18 deletions docker/yio-image/scripts/yio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ LINGUIST_LRELEASE=/usr/lib/qt5/bin/lrelease
#=============================================================

GitProjects=(
"https://github.com/YIO-Remote/integration.dock.git,dev"
"https://github.com/YIO-Remote/integration.homey.git,dev"
"https://github.com/YIO-Remote/integration.home-assistant.git,dev"
"https://github.com/YIO-Remote/integration.ir.git,dev"
"https://github.com/YIO-Remote/integration.openhab.git,dev"
"https://github.com/YIO-Remote/integration.openweather.git,dev"
"https://github.com/YIO-Remote/integration.roon.git,develop"
"https://github.com/YIO-Remote/integration.spotify.git,dev"
"https://github.com/YIO-Remote/remote-os.git,feature/develop"
"https://github.com/YIO-Remote/remote-software.git,develop"
"https://github.com/YIO-Remote/integration.dock.git,master"
"https://github.com/YIO-Remote/integration.homey.git,master"
"https://github.com/YIO-Remote/integration.home-assistant.git,master"
"https://github.com/YIO-Remote/integration.openhab.git,master"
"https://github.com/YIO-Remote/integration.openweather.git,master"
"https://github.com/YIO-Remote/integration.roon.git,master"
"https://github.com/YIO-Remote/integration.spotify.git,master"
"https://github.com/YIO-Remote/remote-os.git,feature/master"
"https://github.com/YIO-Remote/remote-software.git,master"
"https://github.com/YIO-Remote/web-configurator.git,master"
)

Expand Down Expand Up @@ -297,29 +296,30 @@ buildQtProject() {

# HACK transfer built remote application and plugins to remote-os.
# Ok for initial test version, but we need to clean up the binary handling in remote-os!
BUILDROOT_DEST="${YIO_SRC}/remote-os/overlay/usr/bin/yio-remote"
BUILDROOT_DEST="${YIO_SRC}/remote-os/overlay/opt/yio/app"
echo "Copying remote-software binary and plugins to remote-os: $BUILDROOT_DEST"
header "WARNING: work in progress until there are remote-software & plugin releases!"

rm -Rf "${BUILDROOT_DEST}"/fonts/*
rm -Rf "${BUILDROOT_DEST}"/icons/*
rm -Rf "${BUILDROOT_DEST}"/plugins/*
rm -Rf "${BUILDROOT_DEST}"/www/config/*
rm -Rf "${YIO_SRC}"/app-plugins/*
rm -Rf "${YIO_SRC}"/web-configurator/config/*

mkdir -p "${BUILDROOT_DEST}"/fonts
mkdir -p "${BUILDROOT_DEST}"/icons
mkdir -p "${BUILDROOT_DEST}"/plugins
mkdir -p "${BUILDROOT_DEST}"/www/config
mkdir -p "${YIO_SRC}"/app-plugins
mkdir -p "${YIO_SRC}"/web-configurator/config

cp "${BUILD_BINARY_DIR}"/config.json "${YIO_SRC}"/remote-os/rpi0/boot/
cp "${BUILD_BINARY_DIR}"/remote "${BUILDROOT_DEST}"
chmod 755 "${BUILDROOT_DEST}"/remote
cp "${BUILD_BINARY_DIR}"/translations.json "${BUILDROOT_DEST}"
cp "${BUILD_BINARY_DIR}"/*.json "${BUILDROOT_DEST}"

cp -r "${BUILD_BINARY_DIR}"/fonts "${BUILDROOT_DEST}"
cp -r "${BUILD_BINARY_DIR}"/icons "${BUILDROOT_DEST}"
cp -r "${BUILD_BINARY_DIR}"/plugins "${BUILDROOT_DEST}"
cp -r "${YIO_SRC}"/web-configurator/* "${BUILDROOT_DEST}/www/config/"

cp -r "${BUILD_BINARY_DIR}"/plugins "${YIO_SRC}/app-plugins"
cp -r "${BUILD_BINARY_DIR}"/web-configurator/* "${YIO_SRC}/web-configurator/config/"
fi
}

Expand Down
27 changes: 0 additions & 27 deletions overlay/etc/lighttpd/lighttpd-config.conf

This file was deleted.

39 changes: 0 additions & 39 deletions overlay/etc/lighttpd/lighttpd-wifisetup.conf

This file was deleted.

18 changes: 12 additions & 6 deletions overlay/etc/lighttpd/lighttpd.conf
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
server.document-root = "/usr/bin/yio-remote/www/"
server.document-root = "/opt/yio/web-configurator/"

server.port = 80

server.modules = (
"mod_access",
"mod_accesslog",
# "mod_access",
# "mod_accesslog",
"mod_fastcgi",
"mod_rewrite",
"mod_auth",
# "mod_auth",
"mod_redirect"
)

index-file.names += ( "index.php" )
index-file.names = ( "index.html", "index.php" )

fastcgi.server = ( ".php" => ((
"bin-path" => "/usr/bin/php-cgi",
Expand All @@ -22,5 +22,11 @@ mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".png" => "image/png"
".png" => "image/png",
".css" => "text/css",
".otf" => "font/ttf",
".ttf" => "font/ttf",
".woff" => "font/woff",
".woff2" => "font/woff2",
".svg" => "image/svg+xml"
)
13 changes: 13 additions & 0 deletions overlay/etc/profile.d/yio.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# home directory is not freely changeable!
# systemd services don't support env variables in ExecStart!
export YIO_HOME=/opt/yio
export YIO_APP_DIR=${YIO_HOME}/app
export YIO_PLUGIN_DIR=${YIO_HOME}/app-plugins
export YIO_MEDIA_DIR=${YIO_HOME}/media
export YIO_SCRIPT_DIR=${YIO_HOME}/scripts
# remote-os release, set during build
export YIO_OS_VERSION=$BUILD_VERSION
# Git hash of the remote-os repo, set during build
export YIO_OS_GITHASH=$GIT_HASH
export YIO_LOG_DIR=/var/log
export YIO_LOG_DIR_UPDATE=/boot/log
2 changes: 1 addition & 1 deletion overlay/etc/systemd/system/app.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ After=sharp-init.service

[Service]
Type=simple
ExecStart=/usr/bin/yio-remote/app-launch.sh
ExecStart=/opt/yio/app-launch.sh
RemainAfterExit=yes

[Install]
Expand Down
2 changes: 1 addition & 1 deletion overlay/etc/systemd/system/backlight.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DefaultDependencies=false

[Service]
Type=simple
ExecStart=/usr/bin/yio-remote/sharp-backlight-init.sh
ExecStart=/opt/yio/scripts/sharp-backlight-init.sh
RemainAfterExit=yes

[Install]
Expand Down
2 changes: 1 addition & 1 deletion overlay/etc/systemd/system/sharp-init.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/yio-remote/sharp-init
ExecStart=/opt/yio/scripts/sharp-init
RemainAfterExit=yes

[Install]
Expand Down
11 changes: 0 additions & 11 deletions overlay/etc/systemd/system/shutdown.service

This file was deleted.

10 changes: 0 additions & 10 deletions overlay/etc/systemd/system/update.service

This file was deleted.

2 changes: 2 additions & 0 deletions overlay/etc/wpa_supplicant/wpa_supplicant-wlan0.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 585d302

Please sign in to comment.