install.sh: xbps-install (void linux) support (#317)

* install.sh: xbps-install (void linux) support
This commit is contained in:
Neil O'Toole 2023-09-24 17:27:42 -06:00 committed by GitHub
parent a43bd3c221
commit 99698bf15c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 2 deletions

View File

@ -182,6 +182,24 @@ jobs:
exit 1 exit 1
fi fi
void-linux:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
container: ghcr.io/void-linux/void-glibc:latest
steps:
- name: Test install
run: |-
set -e
(xbps-install -Syu || true) && xbps-install -yu xbps curl
/bin/sh -c "$(curl -fsSL https://sq.io/install.sh)"
if [ $(sq version | awk '{print $1}') != "sq" ]; then
# NOTE: The Void package release is a manual process.
# Thus, the released version will not match this particular
# workflow release. We'll just do a simple test here.
echo "FAIL: sq install not working for some reason"
exit 1
fi
windows-scoop: windows-scoop:
runs-on: windows-latest runs-on: windows-latest
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')

View File

@ -15,15 +15,25 @@ get_distribution() {
echo "$lsb_dist" echo "$lsb_dist"
} }
# Usage: # Use command exists to test if a command is present on the system. E.g.
# #
# if command_exists lsb_release; then # if command_exists lsb_release; then
command_exists() { command_exists() {
command -v "$@" > /dev/null 2>&1 command -v "$@" > /dev/null 2>&1
} }
get_distribution get_distribution
# Void Linux / xbps
if command_exists xbps-install; then
set -e
printf "Using xbps-install to install sq...\n\n"
(xbps-install -Syu || true) && xbps-install -yu xbps
xbps-install -yu sq
exit
fi
# apt / deb # apt / deb
if [ -r /etc/debian_version ] && command_exists apt; then if [ -r /etc/debian_version ] && command_exists apt; then
set -e set -e