Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.2 Release #106

Merged
merged 17 commits into from
Nov 25, 2024
74 changes: 33 additions & 41 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,46 @@ name: publish dockers
on:
push:
tags:
- 'docekr-v*'
- "v*"
jobs:
release-github:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
-
uses: actions/checkout@v4
-
name: Build image
run: docker build . --file Dockerfile --tag turn-server --label "runnumber=${GITHUB_RUN_ID}"
-
name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
-
name: Push image
run: |
IMAGE_ID=$(echo "ghcr.io/${{ github.repository_owner }}/turn-server" | tr '[A-Z]' '[a-z]')
docker tag turn-server $IMAGE_ID:${{github.ref_name}}
docker push $IMAGE_ID:${{github.ref_name}}
docker tag turn-server $IMAGE_ID:latest
docker push $IMAGE_ID:latest
- uses: actions/checkout@v4
- name: Build image
run: docker build . --file Dockerfile --tag turn-server --label "runnumber=${GITHUB_RUN_ID}"
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Push image
run: |
IMAGE_ID=$(echo "ghcr.io/${{ github.repository_owner }}/turn-server" | tr '[A-Z]' '[a-z]')
docker tag turn-server $IMAGE_ID:${{github.ref_name}}
docker push $IMAGE_ID:${{github.ref_name}}
docker tag turn-server $IMAGE_ID:latest
docker push $IMAGE_ID:latest
release-dockerhub:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v4
with:
submodules: true
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to GithubPackages
uses: docker/login-action@v2
with:
username: '${{ secrets.DOCKERHUB_USERNAME }}'
password: '${{ secrets.DOCKERHUB_TOKEN }}'
-
name: build and push docker image
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64
push: true
file: Dockerfile
cache-from: type=gha
cache-to: 'type=gha,mode=max'
tags: quasipaa/turn-server:${{github.ref_name}}, quasipaa/turn-server:latest
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GithubPackages
uses: docker/login-action@v2
with:
username: "${{ secrets.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
- name: build and push docker image
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64
push: true
file: Dockerfile
cache-from: type=gha
cache-to: "type=gha,mode=max"
tags: quasipaa/turn-server:${{github.ref_name}}, quasipaa/turn-server:latest
152 changes: 70 additions & 82 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: publish release
on:
push:
tags:
- 'v*'
- "v*"
jobs:
build:
runs-on: '${{ matrix.os }}'
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os:
Expand Down Expand Up @@ -40,87 +40,75 @@ jobs:
- 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'') }}'
-
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
-
name: Build release (Linux & Macos)
if: runner.os == 'Macos' || runner.os == 'Linux'
run: cargo zigbuild --target ${{ matrix.target }} --release
-
name: Build release (Windows)
if: runner.os == 'Windows'
run: cargo build --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";
-
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
- 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') }}"
- 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
- name: Build release (Linux & Macos)
if: runner.os == 'Macos' || runner.os == 'Linux'
run: cargo zigbuild --target ${{ matrix.target }} --release
- name: Build release (Windows)
if: runner.os == 'Windows'
run: cargo build --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";
- 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/**/*
- 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/**/*
27 changes: 12 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,15 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v4
-
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: '${{ runner.os }}-cargo-${{ hashFiles(''**/Cargo.lock'') }}'
-
name: Run tests
run: cargo test
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: "${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}"
- name: Run tests
run: cargo test
Loading