Skip to content

fix: version number #92

fix: version number

fix: version number #92

Workflow file for this run

name: publish release
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
target:
- aarch64-apple-darwin
- aarch64-unknown-linux-gnu
- x86_64-apple-darwin
- x86_64-pc-windows-msvc
- x86_64-unknown-linux-gnu
exclude:
- os: windows-latest
target: aarch64-unknown-linux-gnu
- os: windows-latest
target: x86_64-unknown-linux-gnu
- os: windows-latest
target: aarch64-apple-darwin
- os: windows-latest
target: x86_64-apple-darwin
- os: ubuntu-latest
target: x86_64-pc-windows-msvc
- os: ubuntu-latest
target: aarch64-apple-darwin
- os: ubuntu-latest
target: x86_64-apple-darwin
- os: macos-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: aarch64-unknown-linux-gnu
- os: macos-latest
target: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: "${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}"
# Install dependencies
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y gcc-aarch64-linux-gnu
rustup target add ${{ matrix.target }}
cargo install cargo-zigbuild
sudo snap install zig --classic --beta
- name: Install dependencies (Macos)
if: runner.os == 'Macos'
run: |
rustup target add ${{ matrix.target }}
cargo install cargo-zigbuild
brew install zig
# Build release
- name: Build release (Linux & Macos)
if: runner.os == 'Macos' || runner.os == 'Linux'
run: cargo zigbuild --target ${{ matrix.target }} --release --all-features
- name: Build release (Windows)
if: runner.os == 'Windows'
run: cargo build --release --all-features
# Rename release
- name: Rename release (Linux & Macos)
if: runner.os == 'Macos' || runner.os == 'Linux'
run: |
mv ./target/${{ matrix.target }}/release/turn-server ./target/${{ matrix.target }}/release/turn-server-${{ matrix.target }}
- name: Rename release (Windows)
if: runner.os == 'Windows'
run: |
Remove-Item -Path "./target/release/turn-server-${{ matrix.target }}.exe" -ErrorAction SilentlyContinue;
Rename-Item -Path "./target/release/turn-server.exe" -NewName "turn-server-${{ matrix.target }}.exe";
# Upload artifact
- name: Upload artifact (Linux & Macos)
if: runner.os == 'Macos' || runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: |
./target/${{ matrix.target }}/release/turn-server-${{ matrix.target }}
- name: Upload artifact (Windows)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: |
./target/release/turn-server-${{ matrix.target }}.exe
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
draft: false
prerelease: false
files: artifacts/**/*