diff --git a/.github/scripts/ubuntu/build_deb.sh b/.github/scripts/ubuntu/build_deb.sh new file mode 100755 index 0000000..c9836bf --- /dev/null +++ b/.github/scripts/ubuntu/build_deb.sh @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 974040b..65b2b09 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -117,6 +117,34 @@ jobs: if: ${{ github.ref == 'refs/heads/master' }} run: | 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: needs: ["extract-version", "create-release"] diff --git a/espanso/Cargo.toml b/espanso/Cargo.toml index 1fd9009..de5e494 100644 --- a/espanso/Cargo.toml +++ b/espanso/Cargo.toml @@ -72,4 +72,16 @@ espanso-mac-utils = { path = "../espanso-mac-utils" } [target.'cfg(target_os="linux")'.dependencies] caps = "0.5.2" const_format = "0.2.14" -regex = "1.4.3" \ No newline at end of file +regex = "1.4.3" + +[package.metadata.deb] +maintainer = "Federico Terzi " +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