Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mycrl committed Sep 14, 2024
1 parent d7b9785 commit 9186bdf
Showing 1 changed file with 19 additions and 56 deletions.
75 changes: 19 additions & 56 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ on:
- 'v*'
jobs:
build:
runs-on: '${{ matrix.os }}'
runs-on: ubuntu-latest
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
arch:
- x86_64
- aarch64
exclude:
- os: windows-latest
arch: aarch64
target:
- aarch64-apple-darwin
- aarch64-pc-windows-msvc
- aarch64-unknown-linux-musl
- loongarch64-unknown-linux-musl
- powerpc64-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
- x86_64-apple-darwin
- x86_64-pc-windows-msvc
- x86_64-unknown-linux-musl
steps:
-
uses: actions/checkout@v4
Expand All @@ -31,7 +32,7 @@ jobs:
target/
key: '${{ runner.os }}-cargo-${{ hashFiles(''**/Cargo.lock'') }}'
-
name: Install dependencies (Linux)
name: Install dependencies
if: runner.os == 'Linux'
run: |
sudo apt update
Expand All @@ -40,57 +41,19 @@ jobs:
which cargo-zigbuild || cargo install cargo-zigbuild
sudo snap install zig --classic --beta
-
name: Build release (Windows)
if: runner.os == 'Windows' && matrix.arch == 'x86_64'
run: cargo build --release
-
name: Build release (Linux)
if: runner.os == 'Linux' && matrix.arch == 'x86_64'
run: cargo build --release
-
name: Build release (Linux aarch64)
if: runner.os == 'Linux' && matrix.arch == 'aarch64'
run: cargo zigbuild --target aarch64-unknown-linux-gnu --release
-
name: Rename release (Linux)
if: runner.os == 'Linux' && matrix.arch == 'x86_64'
run: |
mv ./target/release/turn-server ./target/release/turn-server-linux-x86_64
-
name: Rename release (Linux)
if: runner.os == 'Linux' && matrix.arch == 'aarch64'
run: |
mv ./target/aarch64-unknown-linux-gnu/release/turn-server ./target/aarch64-unknown-linux-gnu/release/turn-server-linux-aarch64
name: Build release
run: cargo zigbuild --target ${{ matrix.arch }} --release
-
name: Rename release (Windows)
if: runner.os == 'Windows' && matrix.arch == 'x86_64'
name: Rename release
run: |
Remove-Item -Path "./target/release/turn-server-windows-x86_64.exe" -ErrorAction SilentlyContinue;
Rename-Item -Path "./target/release/turn-server.exe" -NewName "turn-server-windows-x86_64.exe";
-
name: Upload artifact (Linux)
if: runner.os == 'Linux' && matrix.arch == 'x86_64'
uses: actions/upload-artifact@v4
with:
name: linux-x86_64
path: |
./target/release/turn-server-linux-x86_64
-
name: Upload artifact (Linux)
if: runner.os == 'Linux' && matrix.arch == 'aarch64'
uses: actions/upload-artifact@v4
with:
name: linux-aarch64
path: |
./target/aarch64-unknown-linux-gnu/release/turn-server-linux-aarch64
mv ./target/release/turn-server ./target/release/turn-server-${{ matrix.arch }}
-
name: Upload artifact (Windows)
if: runner.os == 'Windows' && matrix.arch == 'x86_64'
name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: windows-x86_64
name: ${{ matrix.arch }}
path: |
./target/release/turn-server-windows-x86_64.exe
./target/release/turn-server-${{ matrix.arch }}
deploy:
needs: build
runs-on: ubuntu-latest
Expand Down

0 comments on commit 9186bdf

Please sign in to comment.