fix(ci): simplify workflow to Ubuntu-only runners for Gitea Actions
This commit is contained in:
+17
-65
@@ -14,20 +14,8 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
# Test job
|
# Test job
|
||||||
test:
|
test:
|
||||||
name: Test (${{ matrix.os }})
|
name: Test
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-latest
|
||||||
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:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
@@ -39,11 +27,10 @@ jobs:
|
|||||||
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
||||||
export PATH="$HOME/.cargo/bin:$PATH"
|
export PATH="$HOME/.cargo/bin:$PATH"
|
||||||
fi
|
fi
|
||||||
rustup toolchain install stable --profile minimal --target ${{ matrix.target }}
|
rustup toolchain install stable --profile minimal --target x86_64-unknown-linux-gnu
|
||||||
rustup default stable
|
rustup default stable
|
||||||
|
|
||||||
- name: Install system dependencies (Linux)
|
- name: Install system dependencies
|
||||||
if: runner.os == 'Linux'
|
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
@@ -63,9 +50,8 @@ jobs:
|
|||||||
~/.cargo/registry
|
~/.cargo/registry
|
||||||
~/.cargo/git
|
~/.cargo/git
|
||||||
src/target
|
src/target
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('src/Cargo.lock') }}
|
key: linux-cargo-${{ hashFiles('src/Cargo.lock') }}
|
||||||
restore-keys: |
|
restore-keys: linux-cargo-
|
||||||
${{ runner.os }}-cargo-
|
|
||||||
|
|
||||||
- name: Check
|
- name: Check
|
||||||
working-directory: src
|
working-directory: src
|
||||||
@@ -106,28 +92,11 @@ jobs:
|
|||||||
name: frontend-dist
|
name: frontend-dist
|
||||||
path: src/tauri-app/frontend/dist/
|
path: src/tauri-app/frontend/dist/
|
||||||
|
|
||||||
# Build desktop apps
|
# Build desktop app (Linux only)
|
||||||
build-desktop:
|
build-desktop:
|
||||||
name: Build Desktop (${{ matrix.platform }})
|
name: Build Desktop (Linux)
|
||||||
needs: [test, build-frontend]
|
needs: [test, build-frontend]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-latest
|
||||||
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:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
@@ -139,11 +108,10 @@ jobs:
|
|||||||
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
||||||
export PATH="$HOME/.cargo/bin:$PATH"
|
export PATH="$HOME/.cargo/bin:$PATH"
|
||||||
fi
|
fi
|
||||||
rustup toolchain install stable --profile minimal --target ${{ matrix.target }}
|
rustup toolchain install stable --profile minimal --target x86_64-unknown-linux-gnu
|
||||||
rustup default stable
|
rustup default stable
|
||||||
|
|
||||||
- name: Install system dependencies (Linux)
|
- name: Install system dependencies
|
||||||
if: matrix.platform == 'linux'
|
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
@@ -169,40 +137,24 @@ jobs:
|
|||||||
~/.cargo/registry
|
~/.cargo/registry
|
||||||
~/.cargo/git
|
~/.cargo/git
|
||||||
src/target
|
src/target
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('src/Cargo.lock') }}
|
key: linux-cargo-${{ hashFiles('src/Cargo.lock') }}
|
||||||
restore-keys: |
|
restore-keys: linux-cargo-
|
||||||
${{ runner.os }}-cargo-
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: src
|
working-directory: src
|
||||||
run: cargo build --release
|
run: cargo build --release
|
||||||
|
|
||||||
- name: Package (Linux)
|
- name: Package
|
||||||
if: matrix.platform == 'linux'
|
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
cp src/target/release/re-teamspeak dist/ || true
|
cp src/target/release/re-teamspeak dist/ || true
|
||||||
tar -czf re-teamspeak-${{ matrix.artifact }}.tar.gz -C dist .
|
tar -czf re-teamspeak-linux-amd64.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
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: re-teamspeak-${{ matrix.artifact }}
|
name: re-teamspeak-linux-amd64
|
||||||
path: re-teamspeak-${{ matrix.artifact }}.*
|
path: re-teamspeak-linux-amd64.*
|
||||||
|
|
||||||
# Release
|
# Release
|
||||||
release:
|
release:
|
||||||
|
|||||||
Reference in New Issue
Block a user