From 7084fc818884fc9373c938426747d44e26271aac Mon Sep 17 00:00:00 2001 From: leukipp Date: Thu, 9 Jan 2025 14:36:09 +0100 Subject: [PATCH] build: add amd64 releases --- .github/workflows/release.yaml | 5 +---- install.sh | 35 +++++++++++++++++++++++----------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 24e7b0b..39d0a3e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,9 +8,6 @@ on: jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - arch: [arm64] steps: - name: Checkout code uses: actions/checkout@v4 @@ -30,4 +27,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} run: | - yarn electron-forge publish --arch arm64 + yarn electron-forge publish --arch arm64,x64 diff --git a/install.sh b/install.sh index 40185ed..f12d58d 100755 --- a/install.sh +++ b/install.sh @@ -1,10 +1,27 @@ #!/usr/bin/env bash +# Determine system architecture +echo -e "Determining system architecture..." + +case "$(uname -m)" in + aarch64) + ARCH="arm64" + ;; + x86_64) + ARCH="amd64" + ;; + *) + echo "System architecture $(uname -m) not supported." + exit 1 + ;; +esac +echo "System architecture $ARCH is supported." + # Download the latest .deb package -echo -e "Downloading the latest release..." +echo -e "\nDownloading the latest release..." DEB_URL=$(wget -qO- https://api.github.com/repos/leukipp/touchkio/releases/latest | \ -grep -o '"browser_download_url": "[^"]*\.deb"' | \ +grep -o "\"browser_download_url\": \"[^\"]*_${ARCH}\.deb\"" | \ sed 's/"browser_download_url": "//;s/"//g') DEB_PATH="/tmp/$(basename "$DEB_URL")" @@ -21,6 +38,11 @@ fi # Install the latest .deb package echo -e "\nInstalling the latest release..." +if ! command -v dpkg &> /dev/null; then + echo "Package manager dpkg was not found." + exit 1 +fi + if ! sudo dpkg -i "$DEB_PATH"; then echo "Installation of .deb file failed." exit 1 @@ -49,15 +71,6 @@ EOF" systemctl --user enable "$(basename "$SERVICE_FILE")" || { echo "Failed to enable service $SERVICE_FILE"; exit 1; } echo "Service $SERVICE_FILE enabled" -# Create the udev rule for backlight -echo -e "\nCreating udev rule for backlight..." - -UDEV_FILE="/etc/udev/rules.d/backlight-permissions.rules" -sudo bash -c "cat << EOF > \"$UDEV_FILE\" -SUBSYSTEM==\"backlight\", KERNEL==\"10-0045\", RUN+=\"/bin/chmod 666 /sys/class/backlight/%k/bl_power /sys/class/backlight/%k/brightness\" -EOF" -echo "Rule $UDEV_FILE created" - # Export display variables echo -e "\nExporting display variables..."