Skip to content

Commit

Permalink
chore: fixing auto build
Browse files Browse the repository at this point in the history
  • Loading branch information
giangndm committed Nov 23, 2023
1 parent bd9d988 commit 8517421
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 95 deletions.
40 changes: 37 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches: [master]
tags:
- "v*.*.*"
- "atm0s-media-server-v*.*.*"
workflow_dispatch:

concurrency:
Expand Down Expand Up @@ -45,71 +45,91 @@ jobs:
rust: stable
target: x86_64-unknown-linux-gnu
extension: ""
cross: false
# - build: linux musl x64
# os: ubuntu-latest
# rust: stable
# target: x86_64-unknown-linux-musl
# extension: ""
# cross: false
- build: linux gnu aarch64
os: ubuntu-latest
rust: stable
target: aarch64-unknown-linux-gnu
extension: ""
cross: true
# - build: linux musl aarch64
# os: ubuntu-latest
# rust: stable
# target: aarch64-unknown-linux-musl
# extension: ""
# cross: true
# - build: linux gnueabihf arm
# os: ubuntu-latest
# rust: stable
# target: arm-unknown-linux-gnueabihf
# extension: ""
# cross: true
# - build: linux gnueabihf armv7
# os: ubuntu-latest
# rust: stable
# target: armv7-unknown-linux-gnueabihf
# extension: ""
# cross: true
# - build: linux gnu mips
# os: ubuntu-latest
# rust: 1.71.1
# target: mips-unknown-linux-gnu
# extension: ""
# cross: true
# - build: linux gnuabi64 mips64
# os: ubuntu-latest
# rust: 1.71.1
# target: mips64-unknown-linux-gnuabi64
# extension: ""
# cross: true
# - build: linux gnuabi64 mips64el
# os: ubuntu-latest
# rust: 1.71.1
# target: mips64el-unknown-linux-gnuabi64
# extension: ""
# cross: true
# - build: linux gnu mipsel
# os: ubuntu-latest
# rust: 1.71.1
# target: mipsel-unknown-linux-gnu
# extension: ""
# cross: true
# - build: linux musl aarch64
# os: ubuntu-latest
# rust: stable
# target: aarch64-unknown-linux-musl
# extension: ""
# cross: true
- build: macos x64
os: macos-latest
rust: stable
target: x86_64-apple-darwin
extension: ""
cross: false
- build: macos aarch64
os: macos-latest
rust: stable
target: aarch64-apple-darwin
extension: ""
cross: false
# - build: windows gnu x64
# os: ubuntu-latest
# rust: stable
# target: x86_64-pc-windows-gnu
# extension: ".exe"
# cross: false
# - build: windows msvc x64
# os: windows-latest
# rust: stable
# target: x86_64-pc-windows-msvc
# extension: ".exe"
# cross: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -122,10 +142,24 @@ jobs:
override: true
target: ${{ matrix.target }}

- name: Install dev-tools
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y --no-install-recommends pkg-config musl-dev musl-tools

- name: Install deps (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y --no-install-recommends libssl-dev libopus-dev libfdk-aac-dev

- name: Install deps (macos)
if: matrix.os == 'macos-latest'
run: |
brew update
brew install openssl opus fdk-aac
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: true
use-cross: ${{ matrix.cross }}
command: build
args: --verbose --release --package ${{ env.APP_NAME }} --target ${{ matrix.target }}

Expand Down Expand Up @@ -204,4 +238,4 @@ jobs:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
93 changes: 1 addition & 92 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,97 +10,6 @@ env:
CARGO_TERM_COLOR: always

jobs:
cross-platform-test:
strategy:
matrix:
build:
- linux gnu x64
# - linux musl x64
- linux gnu aarch64
# - linux musl aarch64
# - linux gnueabihf arm
# - linux gnueabihf armv7
# - linux gnu mips
# - linux gnuabi64 mips64
# - linux gnuabi64 mips64el
# - linux gnu mipsel
- macos x64
# - macos aarch64
# - windows gnu x64
# - windows msvc x64
include:
- build: linux gnu x64
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-gnu
# - build: linux musl x64
# os: ubuntu-latest
# rust: stable
# target: x86_64-unknown-linux-musl
- build: linux gnu aarch64
os: ubuntu-latest
rust: stable
target: aarch64-unknown-linux-gnu
# - build: linux gnueabihf arm
# os: ubuntu-latest
# rust: stable
# target: arm-unknown-linux-gnueabihf
# - build: linux gnueabihf armv7
# os: ubuntu-latest
# rust: stable
# target: armv7-unknown-linux-gnueabihf
# - build: linux gnu mips
# os: ubuntu-latest
# rust: 1.71.1
# target: mips-unknown-linux-gnu
# - build: linux gnuabi64 mips64
# os: ubuntu-latest
# rust: 1.71.1
# target: mips64-unknown-linux-gnuabi64
# - build: linux gnuabi64 mips64el
# os: ubuntu-latest
# rust: 1.71.1
# target: mips64el-unknown-linux-gnuabi64
# - build: linux gnu mipsel
# os: ubuntu-latest
# rust: 1.71.1
# target: mipsel-unknown-linux-gnu
# - build: linux musl aarch64
# os: ubuntu-latest
# rust: stable
# target: aarch64-unknown-linux-musl
- build: macos x64
os: macos-latest
rust: stable
target: x86_64-apple-darwin
# - build: macos aarch64
# os: macos-latest
# rust: stable
# target: aarch64-apple-darwin
# - build: windows gnu x64
# os: ubuntu-latest
# rust: stable
# target: x86_64-pc-windows-gnu
# - build: windows msvc x64
# os: windows-latest
# rust: stable
# target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Test
uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
args: --verbose --all-features --workspace --target ${{ matrix.target }}
code-coverage:
runs-on: ubuntu-latest
env:
Expand All @@ -110,7 +19,7 @@ jobs:
- name: Install deps
run: |
sudo apt-get update
sudo apt install -y libsoxr-dev libopus-dev
sudo apt install -y libsoxr-dev libopus-dev libssl-dev libfdk-aac-dev
- name: Install Rust
run: rustup update stable
- name: Install cargo-llvm-cov
Expand Down
8 changes: 8 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[target.aarch64-unknown-linux-gnu]
pre-build = ["dpkg --add-architecture arm64 && apt-get update && apt-get install --assume-yes libssl-dev:arm64 libopus-dev:arm64"]

[target.aarch64-unknown-linux-musl]
pre-build = ["dpkg --add-architecture arm64 && apt-get update && apt-get install --assume-yes libssl-dev:arm64 libopus-dev:arm64"]

[target.x86_64-pc-windows-gnu]
pre-build = ["apt-get update && apt-get install --assume-yes libssl-dev libopus-dev"]
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ allow = [
"OpenSSL", # https://www.openssl.org/source/license.html - used on Linux
"Unicode-DFS-2016", # https://spdx.org/licenses/Unicode-DFS-2016.html
"Zlib", # https://tldrlegal.com/license/zlib-libpng-license-(zlib)
"LGPL-2.0", # https://www.gnu.org/licenses/old-licenses/lgpl-2.0.en.html
]

0 comments on commit 8517421

Please sign in to comment.