build(deps): update clap
to 4.4.6
#177
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: โ๏ธ๐ | |
on: | |
pull_request: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
tags: ["*"] | |
concurrency: | |
group: ci-cd-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
code-quality: | |
name: ๐ฆ Code Quality | |
runs-on: ubuntu-latest | |
steps: | |
- name: ๐๏ธ Checkout | |
uses: actions/checkout@v4.1.0 | |
- name: ๐ฆ Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy, rustfmt | |
- name: โป๏ธ Manage Cache | |
uses: actions/cache@v3.3.1 | |
with: | |
path: | | |
~/.cargo/ | |
target/ | |
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} | |
cargo-${{ runner.os }}- | |
- name: ๐จ Check Formatting | |
run: cargo fmt --check --all | |
- name: ๐ Check Linting | |
run: cargo clippy --locked --all-targets --all-features -- -D warnings | |
- name: ๐งช Run Tests | |
run: cargo test --locked --all-targets --all-features | |
build-artifacts: | |
name: โ๏ธ Build (${{ matrix.artifact-name }}) | |
needs: [code-quality] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
artifact-name: chara-x86_64-unknown-linux-gnu | |
cargo-target: x86_64-unknown-linux-gnu | |
- os: ubuntu-latest | |
artifact-name: chara-aarch64-unknown-linux-gnu | |
cargo-target: aarch64-unknown-linux-gnu | |
linker: gcc-aarch64-linux-gnu | |
- os: ubuntu-latest | |
artifact-name: chara-aarch64-linux-android | |
cargo-target: aarch64-linux-android | |
- os: macos-latest | |
artifact-name: chara-x86_64-apple-darwin | |
cargo-target: x86_64-apple-darwin | |
- os: windows-latest | |
artifact-name: chara-x86_64-pc-windows-gnu | |
cargo-target: x86_64-pc-windows-gnu | |
steps: | |
- name: ๐๏ธ Checkout | |
uses: actions/checkout@v4.1.0 | |
- name: ๐ฆ Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
target: ${{ matrix.cargo-target }} | |
- name: ๐ Install Linker packages | |
if: matrix.linker != '' | |
run: | | |
sudo apt-get -y update | |
sudo apt-get -y install ${{ matrix.linker }} | |
- name: ๐ฃ๏ธ Set Linker Path | |
if: matrix.cargo-target == 'aarch64-linux-android' | |
run: echo "$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH | |
- name: โป๏ธ Manage Build Cache | |
uses: actions/cache@v3.3.1 | |
with: | |
path: | | |
~/.cargo/ | |
target/ | |
key: cargo-${{ matrix.artifact-name }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
cargo-${{ matrix.artifact-name }}-${{ hashFiles('**/Cargo.lock') }} | |
cargo-${{ matrix.artifact-name }}- | |
- name: ๐ ๏ธ Build Binary | |
run: cargo build --locked --release --target ${{ matrix.cargo-target }} | |
- name: ๐ Setup Archive + Extension | |
shell: bash | |
run: | | |
mkdir -p staging | |
if [ "${{ matrix.os }}" = "windows-latest" ]; then | |
cp "target/${{ matrix.cargo-target }}/release/chara.exe" staging/ | |
cd staging | |
7z a ../${{ matrix.artifact-name }}.zip * | |
else | |
cp "target/${{ matrix.cargo-target }}/release/chara" staging/ | |
cd staging | |
zip ../${{ matrix.artifact-name }}.zip * | |
fi | |
- name: โฌ๏ธ Upload Binary Artifact | |
uses: actions/upload-artifact@v3.1.3 | |
with: | |
name: ${{ matrix.artifact-name }} | |
path: ${{ matrix.artifact-name }}.zip | |
retention-days: 5 | |
release: | |
name: ๐ Create Release | |
if: github.ref_type == 'tag' | |
needs: [build-artifacts] | |
runs-on: ubuntu-latest | |
steps: | |
- name: โฌ๏ธ Download All Binary Artifacts | |
uses: actions/download-artifact@v3.0.2 | |
- name: ๐๏ธCreate Release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
generate_release_notes: true | |
files: chara-*/*.zip |