chore(deps): bump rand from 0.8.5 to 0.10.1 (#99) #451
This file contains hidden or 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@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - name: ๐ฆ Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - name: โป๏ธ Manage Cache | |
| uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.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 | |
| - name: ๐ฆ Dry-run publish check | |
| run: cargo publish --dry-run | |
| 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@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - 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@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| 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@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
| - name: ๐ฆ Install Rust (stable) | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: ๐ฆ Publish to crates.io | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| run: cargo publish | |
| - name: ๐๏ธ Create Release | |
| uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| generate_release_notes: true | |
| files: chara-*/*.zip |