CI/CD / Test (ubuntu-latest) (push) Successful in 1m37s
CI/CD / Build Frontend (push) Successful in 20s
CI/CD / Test (windows-latest) (push) Has been cancelled
CI/CD / Build Desktop (linux) (push) Has been cancelled
CI/CD / Build Desktop (macos) (push) Has been cancelled
CI/CD / Build Desktop (windows) (push) Has been cancelled
CI/CD / Test (macos-latest) (push) Has been cancelled
CI/CD / Release (push) Has been cancelled
230 lines
6.0 KiB
YAML
230 lines
6.0 KiB
YAML
name: CI/CD
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, master ]
|
|
pull_request:
|
|
branches: [ main, master ]
|
|
release:
|
|
types: [ created ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
# Test job
|
|
test:
|
|
name: Test (${{ matrix.os }})
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
include:
|
|
- os: ubuntu-latest
|
|
target: x86_64-unknown-linux-gnu
|
|
- os: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
- os: macos-latest
|
|
target: x86_64-apple-darwin
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Rust
|
|
shell: bash
|
|
run: |
|
|
if ! command -v rustup >/dev/null 2>&1; then
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
fi
|
|
rustup toolchain install stable --profile minimal --target ${{ matrix.target }}
|
|
rustup default stable
|
|
|
|
- name: Install system dependencies (Linux)
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libdbus-1-dev \
|
|
pkg-config \
|
|
libgtk-3-dev \
|
|
libwebkit2gtk-4.1-dev \
|
|
libayatana-appindicator3-dev \
|
|
librsvg2-dev \
|
|
libssl-dev \
|
|
libasound2-dev
|
|
|
|
- name: Cache cargo
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
src/target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('src/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-
|
|
|
|
- name: Check
|
|
working-directory: src
|
|
run: cargo check -p shared -p tscore -p tsaudio -p tsdb
|
|
|
|
- name: Test
|
|
working-directory: src
|
|
run: cargo test -p shared -p tscore -p tsaudio -p tsdb
|
|
|
|
- name: Clippy
|
|
working-directory: src
|
|
run: cargo clippy -p shared -p tscore -p tsaudio -p tsdb -- -D warnings
|
|
continue-on-error: true
|
|
|
|
# Build frontend
|
|
build-frontend:
|
|
name: Build Frontend
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install dependencies
|
|
working-directory: src/tauri-app/frontend
|
|
run: npm install
|
|
|
|
- name: Build
|
|
working-directory: src/tauri-app/frontend
|
|
run: npm run build
|
|
|
|
- name: Upload frontend artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: frontend-dist
|
|
path: src/tauri-app/frontend/dist/
|
|
|
|
# Build desktop apps
|
|
build-desktop:
|
|
name: Build Desktop (${{ matrix.platform }})
|
|
needs: [test, build-frontend]
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
platform: linux
|
|
target: x86_64-unknown-linux-gnu
|
|
artifact: linux-amd64
|
|
- os: windows-latest
|
|
platform: windows
|
|
target: x86_64-pc-windows-msvc
|
|
artifact: windows-amd64
|
|
- os: macos-latest
|
|
platform: macos
|
|
target: x86_64-apple-darwin
|
|
artifact: macos-amd64
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Rust
|
|
shell: bash
|
|
run: |
|
|
if ! command -v rustup >/dev/null 2>&1; then
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
fi
|
|
rustup toolchain install stable --profile minimal --target ${{ matrix.target }}
|
|
rustup default stable
|
|
|
|
- name: Install system dependencies (Linux)
|
|
if: matrix.platform == 'linux'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libdbus-1-dev \
|
|
pkg-config \
|
|
libgtk-3-dev \
|
|
libwebkit2gtk-4.1-dev \
|
|
libayatana-appindicator3-dev \
|
|
librsvg2-dev \
|
|
libssl-dev \
|
|
libasound2-dev
|
|
|
|
- name: Download frontend artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: frontend-dist
|
|
path: src/tauri-app/frontend/dist/
|
|
|
|
- name: Cache cargo
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
src/target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('src/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-
|
|
|
|
- name: Build
|
|
working-directory: src
|
|
run: cargo build --release
|
|
|
|
- name: Package (Linux)
|
|
if: matrix.platform == 'linux'
|
|
run: |
|
|
mkdir -p dist
|
|
cp src/target/release/re-teamspeak dist/ || true
|
|
tar -czf re-teamspeak-${{ matrix.artifact }}.tar.gz -C dist .
|
|
|
|
- name: Package (Windows)
|
|
if: matrix.platform == 'windows'
|
|
run: |
|
|
mkdir dist
|
|
copy src\target\release\re-teamspeak.exe dist\ || copy src\target\release\re_teamspeak.exe dist\ || echo "Binary not found"
|
|
Compress-Archive -Path dist\* -DestinationPath re-teamspeak-${{ matrix.artifact }}.zip
|
|
|
|
- name: Package (macOS)
|
|
if: matrix.platform == 'macos'
|
|
run: |
|
|
mkdir -p dist
|
|
cp src/target/release/re-teamspeak dist/ || true
|
|
tar -czf re-teamspeak-${{ matrix.artifact }}.tar.gz -C dist .
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: re-teamspeak-${{ matrix.artifact }}
|
|
path: re-teamspeak-${{ matrix.artifact }}.*
|
|
|
|
# Release
|
|
release:
|
|
name: Release
|
|
needs: build-desktop
|
|
if: github.event_name == 'release'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
path: artifacts/
|
|
|
|
- name: Create release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: artifacts/**/*
|
|
draft: true
|
|
generate_release_notes: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|