Files
RemoteDesk/.github/workflows/ci.yml
T
曾志威 5db6b9ef68
ci / rust (push) Canceled after 0s
ci / web (push) Canceled after 0s
ci / package-preview (push) Canceled after 0s
ci / package-installer (push) Canceled after 0s
ci / linux-agent (push) Canceled after 0s
ci / edge-service (push) Canceled after 0s
ci / coturn-pop (push) Canceled after 0s
ci / package-windows-host (push) Canceled after 0s
Initial commit
2026-08-14 00:35:42 +08:00

192 lines
6.5 KiB
YAML

name: ci
on:
push:
pull_request:
permissions:
contents: read
jobs:
rust:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- run: cargo fmt --all -- --check
- run: cargo clippy --workspace --all-targets -- -D warnings
- run: cargo test --workspace
web:
runs-on: windows-latest
defaults:
run:
working-directory: client/web
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: client/web/package-lock.json
- run: npm ci
- run: npm run lint
- run: npm run build
package-preview:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: client/web/package-lock.json
- run: npm ci
working-directory: client/web
- name: Build preview package
shell: pwsh
run: ./packaging/windows/package-preview.ps1
- uses: actions/upload-artifact@v4
with:
name: remotedesk-m0-windows-preview
path: |
artifacts/*.zip
artifacts/SHA256SUMS.txt
if-no-files-found: error
package-installer:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: client/web/package-lock.json
- run: npm ci
working-directory: client/web
- name: Test update manifest generator contract
run: node ./packaging/windows/test-update-manifest.mjs
- name: Build Windows installer
shell: pwsh
run: ./packaging/windows/package-installer.ps1
- uses: actions/upload-artifact@v4
with:
name: remotedesk-m0-windows-installer
path: |
artifacts/*.msi
artifacts/INSTALLER-SHA256SUMS.txt
if-no-files-found: error
linux-agent:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- name: Install Linux media build dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
- name: Test Linux Agent
run: |
cargo test --locked -p remotedesk-agent-runtime
cargo clippy --locked -p remotedesk-agent-runtime --all-targets -- -D warnings
cargo build --locked -p remotedesk-agent-runtime --bin remotedesk-file-session
sh ./packaging/linux/verify-file-resume.sh target/debug/remotedesk-file-session
- name: Build DEB
run: sh ./packaging/linux/package-deb.sh
- name: Build RPM
run: |
sudo apt-get update
sudo apt-get install -y rpm
sh ./packaging/linux/package-rpm.sh
- uses: actions/upload-artifact@v4
with:
name: remotedesk-linux-agent-packages
path: |
artifacts/*.deb
artifacts/*.deb.sha256
artifacts/*.rpm
artifacts/*.rpm.sha256
if-no-files-found: error
edge-service:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- name: Test Edge service
run: |
cargo test --locked -p remotedesk-edge-service
cargo clippy --locked -p remotedesk-edge-service --all-targets -- -D warnings
- name: Build Edge DEB
run: sh ./packaging/edge/package-deb.sh
- uses: actions/upload-artifact@v4
with:
name: remotedesk-edge-package
path: |
artifacts/remotedesk-edge_*.deb
artifacts/remotedesk-edge_*.deb.sha256
if-no-files-found: error
coturn-pop:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install coturn tools
run: |
sudo apt-get update
sudo apt-get install -y coturn
- name: Start isolated TLS POP and verify transports
run: |
set -eu
work=$(mktemp -d)
trap 'test -f "$work/pid" && kill "$(cat "$work/pid")" 2>/dev/null || true; rm -rf "$work"' EXIT
openssl req -x509 -newkey rsa:2048 -nodes -days 1 \
-subj '/CN=RemoteDesk Test CA' -keyout "$work/ca-key.pem" -out "$work/ca.pem"
openssl req -newkey rsa:2048 -nodes -subj '/CN=127.0.0.1' \
-addext 'subjectAltName=IP:127.0.0.1' -keyout "$work/turn-key.pem" -out "$work/turn.csr"
openssl x509 -req -days 1 -in "$work/turn.csr" -CA "$work/ca.pem" \
-CAkey "$work/ca-key.pem" -CAcreateserial -copy_extensions copy \
-out "$work/turn-cert.pem"
secret='ci-turn-rest-secret-0123456789abcdef'
turnserver --fingerprint --use-auth-secret --static-auth-secret "$secret" \
--realm ci.remotedesk.invalid --listening-ip 127.0.0.1 --relay-ip 127.0.0.1 \
--external-ip 127.0.0.1 --listening-port 3478 --tls-listening-port 5349 \
--min-port 49160 --max-port 49179 --cert "$work/turn-cert.pem" \
--pkey "$work/turn-key.pem" --no-cli --no-multicast-peers \
--pidfile "$work/pid" --log-file stdout &
for attempt in $(seq 1 50); do
if turnutils_stunclient -p 3478 127.0.0.1 >/dev/null 2>&1; then break; fi
if [ "$attempt" -eq 50 ]; then echo 'coturn did not become ready' >&2; exit 1; fi
sleep 0.1
done
REMOTEDESK_TURN_REST_SECRET="$secret" \
REMOTEDESK_TURN_VERIFY_CA="$work/ca.pem" \
sh ./packaging/edge/verify-coturn.sh
package-windows-host:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build Windows controlled-endpoint installer
shell: pwsh
run: ./packaging/windows-host/package-host.ps1
- uses: actions/upload-artifact@v4
with:
name: remotedesk-windows-host-installer
path: |
artifacts/RemoteDesk-Host-*.msi
artifacts/HOST-INSTALLER-SHA256SUMS.txt
if-no-files-found: error