feat: add AM as a new source #158
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- master | |
- feat/* | |
- fix/* | |
paths-ignore: | |
- 'README.md' | |
- 'LICENSE' | |
- '.gitignore' | |
- '.vscode/**' | |
tags: | |
- v* | |
pull_request: | |
branches: | |
- master | |
- feat/* | |
- fix/* | |
paths-ignore: | |
- 'README.md' | |
- 'LICENSE' | |
- '.gitignore' | |
- '.vscode/**' | |
env: | |
CARGO_TERM_COLOR: always | |
PKG_CONFIG_SYSROOT_DIR: / | |
permissions: | |
contents: write | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Setup rust cache | |
uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 | |
with: | |
prefix-key: "${{ runner.os }}-tosho-rust" | |
- name: Build | |
run: cargo build --verbose --all | |
- name: Lint | |
run: cargo clippy --verbose --all -- -D warnings | |
- name: Test | |
run: cargo test --verbose --all | |
build: | |
needs: tests | |
strategy: | |
matrix: | |
os: | |
# GNU Linux (x64) | |
- [ubuntu-latest, x86_64-unknown-linux-gnu] | |
# macOS Intel (x64) | |
- [macos-latest, x86_64-apple-darwin] | |
# macOS Apple Silicon (ARM64) | |
- [macos-latest, aarch64-apple-darwin] | |
# Windows 10 (x64) | |
- [windows-latest, x86_64-pc-windows-msvc] | |
fail-fast: false | |
runs-on: ${{ matrix.os[0] }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Rust Target | |
run: | | |
rustup target add ${{ matrix.os[1] }} | |
- name: Setup rust cache | |
uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 | |
with: | |
prefix-key: "${{ runner.os }}-${{ matrix.os[1] }}-tosho-build-rust" | |
- name: Build | |
run: | | |
cargo build --release --verbose --all --target ${{ matrix.os[1] }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tosho-${{ matrix.os[1] }} | |
path: | | |
target/${{ matrix.os[1] }}/release/tosho.exe | |
target/${{ matrix.os[1] }}/release/tosho | |
- name: Prepare release | |
if: matrix.os[0] != 'windows-latest' | |
shell: bash | |
run: | | |
cd target/${{ matrix.os[1] }}/release | |
zip -r tosho-${{ runner.os }}.zip tosho* | |
cd ../../.. | |
- name: Prepare release (Win32) | |
if: matrix.os[0] == 'windows-latest' | |
run: | | |
cd target/${{ matrix.os[1] }}/release | |
Compress-Archive -Path tosho.exe -DestinationPath tosho-${{ matrix.os[1] }}.zip | |
cd ../../.. | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
files: | | |
target/${{ matrix.os[1] }}/release/tosho-${{ matrix.os[1] }}.zip | |
draft: true | |
prerelease: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |
generate_release_notes: true |