refactor(anni): working on anni-cli for adding album #500
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
name: anni-x86_64-unknown-linux-gnu.tar.gz | |
- target: x86_64-unknown-linux-musl | |
os: ubuntu-latest | |
name: anni-x86_64-unknown-linux-musl.tar.gz | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
name: anni-x86_64-pc-windows-msvc.zip | |
- target: x86_64-apple-darwin | |
os: macos-13 | |
name: anni-x86_64-apple-darwin.tar.gz | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
name: anni-aarch64-apple-darwin.tar.gz | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v3 | |
- name: Setup | MUSL Dependencies | |
if: matrix.target == 'x86_64-unknown-linux-musl' | |
run: | | |
sudo apt install musl-tools | |
rustup target add x86_64-unknown-linux-musl | |
- name: Setup | Linux Dependencies | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt install libasound2-dev | |
- name: Setup | Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ matrix.target }}-anni-cache | |
- name: Build | Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --locked --target ${{ matrix.target }}" --workspace --exclude anni-playback | |
- name: PostBuild | Prepare artifacts [Windows] | |
if: matrix.os == 'windows-latest' | |
run: | | |
cd target/${{ matrix.target }}/release | |
strip anni.exe | |
7z a ../../../${{ matrix.name }} anni.exe annil.exe annim.exe | |
cd - | |
- name: PostBuild | Prepare artifacts [-nix] | |
if: matrix.os != 'windows-latest' | |
run: | | |
cd target/${{ matrix.target }}/release | |
strip anni || true | |
tar czvf ../../../${{ matrix.name }} anni annil annim | |
cd - | |
- name: Docker | Prepare Context | |
if: matrix.target == 'x86_64-unknown-linux-musl' && github.ref == 'refs/heads/master' | |
run: | | |
cp target/${{ matrix.target }}/release/anni ./docker/ | |
cp target/${{ matrix.target }}/release/annil ./docker/ | |
cp target/${{ matrix.target }}/release/annim ./docker/ | |
- name: Docker | Build and Publish Annil | |
if: matrix.target == 'x86_64-unknown-linux-musl' && github.ref == 'refs/heads/master' | |
uses: macbre/push-to-ghcr@master | |
with: | |
image_name: projectanni/annil | |
dockerfile: ./docker/Dockerfile | |
context: ./docker | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
env: | |
DOCKER_BUILDKIT: 1 | |
- name: Docker | Build and Publish Annim | |
if: matrix.target == 'x86_64-unknown-linux-musl' && github.ref == 'refs/heads/master' | |
uses: macbre/push-to-ghcr@master | |
with: | |
image_name: projectanni/annim | |
dockerfile: ./docker/Dockerfile.annim | |
context: ./docker | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
env: | |
DOCKER_BUILDKIT: 1 | |
- name: Deploy | Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.name }} | |
path: ${{ matrix.name }} |