ci: verify system dependencies instead of installing them
This commit is contained in:
parent
548b1e38b8
commit
cffb1d8962
2 changed files with 25 additions and 47 deletions
|
|
@ -21,21 +21,18 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install system dependencies
|
- name: Verify system dependencies
|
||||||
run: |
|
run: |
|
||||||
# Self-hosted host: install packages only if we may; otherwise assume they are preinstalled.
|
set -euo pipefail
|
||||||
if [ "$(id -u)" != 0 ] && ! sudo -n true 2>/dev/null; then
|
# The runner is a developer machine (not Debian): never install system packages from CI.
|
||||||
echo "::warning::no root/passwordless sudo on the runner, skipping apt (dependencies must be preinstalled)"
|
miss=0
|
||||||
exit 0
|
for t in cmake protoc zip pkg-config python3 curl git; do
|
||||||
fi
|
command -v "$t" >/dev/null || { echo "::error::missing tool: $t"; miss=1; }
|
||||||
SUDO=$(command -v sudo || true)
|
done
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
for m in alsa opus libudev gstreamer-1.0 gstreamer-app-1.0 gstreamer-video-1.0 gstreamer-webrtc-1.0 gstreamer-sdp-1.0 openssl xkbcommon wayland-client fontconfig dbus-1; do
|
||||||
$SUDO apt-get update
|
pkg-config --exists "$m" || { echo "::error::missing pkg-config module: $m"; miss=1; }
|
||||||
$SUDO apt-get install -y --no-install-recommends \
|
done
|
||||||
build-essential curl ca-certificates pkg-config cmake protobuf-compiler \
|
[ "$miss" = 0 ]
|
||||||
libasound2-dev libopus-dev libudev-dev \
|
|
||||||
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev \
|
|
||||||
libssl-dev libxkbcommon-dev libwayland-dev libfontconfig1-dev libdbus-1-dev
|
|
||||||
|
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -44,8 +41,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
. "$HOME/.cargo/env" 2>/dev/null || true
|
. "$HOME/.cargo/env" 2>/dev/null || true
|
||||||
rustup toolchain install stable --profile minimal -c rustfmt -c clippy
|
rustup toolchain install stable --profile minimal -c rustfmt -c clippy
|
||||||
rustup default stable
|
rustup component add rustfmt clippy
|
||||||
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
|
||||||
cargo --version
|
cargo --version
|
||||||
|
|
||||||
- name: Cache cargo
|
- name: Cache cargo
|
||||||
|
|
|
||||||
|
|
@ -42,29 +42,18 @@ jobs:
|
||||||
python3 scripts/release/extract_changelog.py "$VERSION" CHANGELOG.md > /dev/null
|
python3 scripts/release/extract_changelog.py "$VERSION" CHANGELOG.md > /dev/null
|
||||||
echo "releasing $VERSION on channel $CHANNEL"
|
echo "releasing $VERSION on channel $CHANNEL"
|
||||||
|
|
||||||
- name: Install system dependencies
|
- name: Verify system dependencies
|
||||||
run: |
|
run: |
|
||||||
# Self-hosted host: install packages only if we may; otherwise assume they are preinstalled.
|
set -euo pipefail
|
||||||
if [ "$(id -u)" != 0 ] && ! sudo -n true 2>/dev/null; then
|
# The runner is a developer machine (not Debian): never install system packages from CI.
|
||||||
echo "::warning::no root/passwordless sudo, verifying preinstalled dependencies instead of installing"
|
miss=0
|
||||||
for t in cmake protoc zip x86_64-w64-mingw32-gcc pkg-config; do
|
for t in cmake protoc zip pkg-config python3 curl git x86_64-w64-mingw32-gcc; do
|
||||||
command -v "$t" >/dev/null || { echo "::error::missing required tool: $t"; exit 1; }
|
command -v "$t" >/dev/null || { echo "::error::missing tool: $t"; miss=1; }
|
||||||
done
|
done
|
||||||
exit 0
|
for m in alsa opus libudev gstreamer-1.0 gstreamer-app-1.0 gstreamer-video-1.0 gstreamer-webrtc-1.0 gstreamer-sdp-1.0 openssl xkbcommon wayland-client fontconfig dbus-1; do
|
||||||
fi
|
pkg-config --exists "$m" || { echo "::error::missing pkg-config module: $m"; miss=1; }
|
||||||
SUDO=$(command -v sudo || true)
|
done
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
[ "$miss" = 0 ]
|
||||||
$SUDO apt-get update
|
|
||||||
$SUDO apt-get install -y --no-install-recommends \
|
|
||||||
build-essential curl ca-certificates pkg-config cmake protobuf-compiler zip \
|
|
||||||
python3 \
|
|
||||||
libasound2-dev libopus-dev libudev-dev \
|
|
||||||
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev \
|
|
||||||
libssl-dev libxkbcommon-dev libwayland-dev libfontconfig1-dev libdbus-1-dev \
|
|
||||||
mingw-w64
|
|
||||||
# Posix threading model is required by the Rust windows-gnu target.
|
|
||||||
$SUDO update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix || true
|
|
||||||
$SUDO update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix || true
|
|
||||||
|
|
||||||
- name: Install pinned Rust toolchain into a throwaway home
|
- name: Install pinned Rust toolchain into a throwaway home
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -138,16 +127,9 @@ jobs:
|
||||||
echo "WIN_ASSET=vnox-client-${VERSION}-windows-x86_64.zip" >> "$GITHUB_ENV"
|
echo "WIN_ASSET=vnox-client-${VERSION}-windows-x86_64.zip" >> "$GITHUB_ENV"
|
||||||
python3 scripts/release/extract_changelog.py "$VERSION" CHANGELOG.md > "$RUNNER_TEMP/changelog.md"
|
python3 scripts/release/extract_changelog.py "$VERSION" CHANGELOG.md > "$RUNNER_TEMP/changelog.md"
|
||||||
|
|
||||||
- name: Install signing dependencies
|
- name: Verify signing dependencies
|
||||||
run: |
|
run: |
|
||||||
# Self-hosted host: install packages only if we may; otherwise assume they are preinstalled.
|
python3 -I -c 'import cryptography' || { echo "::error::python cryptography is missing"; exit 1; }
|
||||||
if [ "$(id -u)" != 0 ] && ! sudo -n true 2>/dev/null; then
|
|
||||||
python3 -I -c 'import cryptography' || { echo "::error::python3 cryptography is not installed and cannot be installed"; exit 1; }
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
SUDO=$(command -v sudo || true)
|
|
||||||
$SUDO apt-get update
|
|
||||||
$SUDO apt-get install -y --no-install-recommends python3 python3-cryptography
|
|
||||||
|
|
||||||
- name: Download build artifacts
|
- name: Download build artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue