diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml new file mode 100644 index 0000000..3e1fed5 --- /dev/null +++ b/.github/actions/build/action.yml @@ -0,0 +1,58 @@ +name: "Build Webgreeter" +description: "Builds webgreeter" +inputs: + target-distro: + required: true + description: "Target distro" +runs: + using: "composite" + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Install dependencies + shell: bash + run: | + sudo apt update + sudo apt install \ + liblightdm-gobject-1-dev \ + libgirepository1.0-dev \ + libqt5webengine5 \ + pyqt5-dev-tools \ + python3-gi \ + python3-pyqt5 \ + python3-ruamel.yaml \ + python3-pyinotify \ + python3-xlib \ + python3-pip \ + dpkg + - + name: Build web-greeter + shell: bash + run: make build + - + name: Prepare deb build (common) + shell: bash + run: | + cp -r build/DEBIAN/ build/install_root/ + - + name: Prepare deb build (for Debian) + shell: bash + if: ${{ inputs.target-distro == 'debian' }} + run: | + sed -i "s/liblightdm-gobject-1-dev/liblightdm-gobject-dev/g" build/install_root/DEBIAN/control + - + name: Build deb + shell: bash + run: | + cd build/ + dpkg-deb --root-owner-group --build install_root "web-greeter.deb" + dpkg --info "./web-greeter.deb" + - + name: 'Upload Artifact' + uses: actions/upload-artifact@v2 + with: + name: build-${{ inputs.target-distro }} + path: ./build/web-greeter.deb + retention-days: 7 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 82fa7b2..2f62746 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,26 +1,27 @@ name: Build Test -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] +on: [push] jobs: - - build: - + build-ubuntu: runs-on: ubuntu-latest - steps: - - - name: Checkout + - + name: Checkout local actions uses: actions/checkout@v2 - - - name: Install dependencies - run: | - sudo apt update - sudo apt install liblightdm-gobject-1-dev libqt5webengine5 pyqt5-dev-tools python3-gi python3-pyqt5 python3-ruamel.yaml python3-pyinotify python3-xlib python3-pip libgirepository1.0-dev build-essential gobject-introspection - name: Build and install web-greeter - run: sudo make install + uses: "./.github/actions/build" + with: + target-distro: ubuntu + build-debian: + runs-on: ubuntu-latest + steps: + - + name: Checkout local actions + uses: actions/checkout@v2 + - + name: Build web-greeter + uses: "./.github/actions/build" + with: + target-distro: debian \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 388b83a..20f2603 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,35 +7,43 @@ on: workflow_dispatch: jobs: - build: - name: Publish binaries + publish-ubuntu: + name: Publish ubuntu binaries runs-on: ubuntu-latest - steps: - - - name: Checkout + - + name: Checkout local actions uses: actions/checkout@v2 - - - name: Install dependencies - run: | - sudo apt update - sudo apt install liblightdm-gobject-1-dev libqt5webengine5 pyqt5-dev-tools python3-gi python3-pyqt5 python3-ruamel.yaml python3-pyinotify python3-xlib python3-pip - sudo apt install dpkg - name: Build and install web-greeter - run: make install + uses: "./.github/actions/build" + with: + target-distro: ubuntu + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: build/web-greeter.deb + asset_name: web-greeter-$tag-ubuntu.deb + tag: ${{ github.ref }} + overwrite: true + publish-debian: + name: Publish debian binaries + runs-on: ubuntu-latest + steps: + - + name: Checkout local actions + uses: actions/checkout@v2 - - name: Build deb - run: | - cd build/ - cp -r DEBIAN/ install_root/ - dpkg-deb --root-owner-group --build install_root "web-greeter.deb" - dpkg --info "./web-greeter.deb" + name: Build web-greeter + uses: "./.github/actions/build" + with: + target-distro: debian - name: Upload binaries to release uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: build/web-greeter.deb - asset_name: web-greeter-$tag.deb + asset_name: web-greeter-$tag-debian.deb tag: ${{ github.ref }} overwrite: true diff --git a/.gitignore b/.gitignore index e40c11a..8f01ae2 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,6 @@ Makefile.in _book/ node_modules/ package-lock.json + +# vscode +.vscode/ \ No newline at end of file diff --git a/README.md b/README.md index f31b7c0..0404553 100644 --- a/README.md +++ b/README.md @@ -41,18 +41,18 @@ apt install ./web-greeter-VER.deb ``` ## Dependencies -| | arch | ubuntu | fedora | openSUSE | -|--------------------------|----------------------|-------------------------|---------------------|----------------------| -|**liblightdm-gobject** |lightdm |liblightdm-gobject-1-dev |lightdm-gobject-devel|liblightdm-gobject-1-0| -|**pygobject** |python-gobject |python3-gi |pygobject3 |python3-gobject | -|**pyqt5** |python-pyqt5 |python3-pyqt5 |python3-qt5 |python3-qt5 | -|**pyqt5-webengine** |python-pyqt5-webengine|python3-pyqt5.qtwebengine|python3-qt5-webengine|python3-qtwebengine | -|**python-yaml** |python-ruamel-yaml |python3-ruamel.yaml |python3-ruamel-yaml |python3-ruamel-yaml | -|**python-inotify** |python-pyinotify |python3-pyinotify |python3-inotify |python3-inotify | -|**qt5-webengine** |qt5-webengine |libqt5webengine5 |qt5-qtwebengine |libqt5-qtwebengine | -|**gobject-introspection** |gobject-introspection |gobject-introspection |gobject-introspection|gobject-introspection | -|**libxcb** |libxcb |libxcb1-dev |libxcb-devel |libxcb | -|**libx11** |libx11 |libx11-dev |libX11-devel |libx11 | +| | arch | ubuntu | fedora | openSUSE | debian | +|--------------------------|----------------------|-------------------------|---------------------|----------------------|-------------------------| +|**liblightdm-gobject** |lightdm |liblightdm-gobject-1-dev |lightdm-gobject-devel|liblightdm-gobject-1-0|liblightdm-gobject-dev | +|**pygobject** |python-gobject |python3-gi |pygobject3 |python3-gobject |python3-gi | +|**pyqt5** |python-pyqt5 |python3-pyqt5 |python3-qt5 |python3-qt5 |python3-pyqt5 | +|**pyqt5-webengine** |python-pyqt5-webengine|python3-pyqt5.qtwebengine|python3-qt5-webengine|python3-qtwebengine |python3-pyqt5.qtwebengine| +|**python-yaml** |python-ruamel-yaml |python3-ruamel.yaml |python3-ruamel-yaml |python3-ruamel-yaml |python3-ruamel.yaml | +|**python-inotify** |python-pyinotify |python3-pyinotify |python3-inotify |python3-inotify |python3-pyinotify | +|**qt5-webengine** |qt5-webengine |libqt5webengine5 |qt5-qtwebengine |libqt5-qtwebengine |libqt5webengine5 | +|**gobject-introspection** |gobject-introspection |gobject-introspection |gobject-introspection|gobject-introspection |gobject-introspection | +|**libxcb** |libxcb |libxcb1-dev |libxcb-devel |libxcb |libxcb1-dev | +|**libx11** |libx11 |libx11-dev |libX11-devel |libx11 |libx11-dev | ### Build dependencies