feat(misc): implement Deb package building pipeline. Fix #932

This commit is contained in:
Federico Terzi 2022-01-10 20:53:56 +01:00
parent d7ee3b3833
commit 671fd3c532
3 changed files with 64 additions and 1 deletions

23
.github/scripts/ubuntu/build_deb.sh vendored Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
set -e
echo "Installing cargo-deb"
cargo install cargo-deb
cd espanso
echo "Building X11 deb package"
cargo deb -p espanso
echo "Building Wayland deb package"
cargo deb -p espanso --variant wayland -- --features wayland
cp espanso/target/debian/espanso_*.deb espanso-debian-x11-amd64.deb
sha256sum espanso-debian-x11-amd64.deb > espanso-debian-x11-amd64-sha256.txt
cp espanso/target/debian/espanso-wayland*.deb espanso-debian-wayland-amd64.deb
sha256sum espanso-debian-wayland-amd64.deb > espanso-debian-wayland-amd64-sha256.txt
ls -la
echo "Copying to mounted volume"
cp espanso-debian-* /shared

View File

@ -118,6 +118,34 @@ jobs:
run: | run: |
gh release upload ${{ needs.extract-version.outputs.espanso_version }} Espanso-X11.AppImage Espanso-X11.AppImage.sha256.txt gh release upload ${{ needs.extract-version.outputs.espanso_version }} Espanso-X11.AppImage Espanso-X11.AppImage.sha256.txt
linux-deb:
needs: ["extract-version", "create-release"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Print target version
run: |
echo Using version ${{ needs.extract-version.outputs.espanso_version }}
- name: Build docker image
run: |
sudo docker build -t espanso-ubuntu . -f .github/scripts/ubuntu/Dockerfile
- name: Build AppImage
run: |
sudo docker run --rm -v "$(pwd):/shared" espanso-ubuntu espanso/.github/scripts/ubuntu/build_deb.sh
- uses: actions/upload-artifact@v2
name: "Upload artifacts"
with:
name: Ubuntu/Debian Artifacts
path: |
espanso-debian-x11-amd64.deb
espanso-debian-wayland-amd64.deb
- name: Upload artifacts to Github Releases (if master)
if: ${{ github.ref == 'refs/heads/master' }}
run: |
gh release upload ${{ needs.extract-version.outputs.espanso_version }} espanso-debian-x11-amd64.deb espanso-debian-wayland-amd64.deb espanso-debian-x11-amd64-sha256.txt espanso-debian-wayland-amd64-sha256.txt
macos-intel: macos-intel:
needs: ["extract-version", "create-release"] needs: ["extract-version", "create-release"]
runs-on: macos-11 runs-on: macos-11

View File

@ -73,3 +73,15 @@ espanso-mac-utils = { path = "../espanso-mac-utils" }
caps = "0.5.2" caps = "0.5.2"
const_format = "0.2.14" const_format = "0.2.14"
regex = "1.4.3" regex = "1.4.3"
[package.metadata.deb]
maintainer = "Federico Terzi <federicoterzi96@gmail.com>"
depends = "$auto, systemd, libxtst6, xclip, libnotify-bin, libxkbcommon0, libwxgtk3.0-0v5"
section = "utility"
license-file = ["../LICENSE", "1"]
[package.metadata.deb.variants.wayland]
depends = "$auto, systemd, libnotify-bin, libxkbcommon0, libwxgtk3.0-0v5"
# TODO: once this issue [1] is fixed, we should create a variant for
# wayland to automatically run the setcap script.
# [1]: https://github.com/mmstick/cargo-deb/issues/151