chore: update repository URLs in metadata and installation instructio… #1
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: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| tags: [ 'v*' ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| test: | |
| name: Test Suite | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| rust: [stable, beta] | |
| exclude: | |
| - os: windows-latest | |
| rust: beta | |
| - os: macos-latest | |
| rust: beta | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| components: rustfmt, clippy | |
| - name: Cache dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Check formatting | |
| run: cargo fmt -- --check | |
| - name: Run clippy | |
| run: cargo clippy -- -D warnings | |
| - name: Run tests | |
| run: cargo test --verbose | |
| - name: Test binary build | |
| run: cargo build --release | |
| security-audit: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit | |
| - name: Run security audit | |
| run: cargo audit | |
| coverage: | |
| name: Code Coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: llvm-tools-preview | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: Generate coverage report | |
| run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: lcov.info | |
| build-release: | |
| name: Build Release Binaries | |
| runs-on: ${{ matrix.os }} | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| suffix: "" | |
| - os: ubuntu-latest | |
| target: aarch64-unknown-linux-gnu | |
| suffix: "" | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| suffix: .exe | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| suffix: "" | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| suffix: "" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross-compilation tools | |
| if: matrix.target == 'aarch64-unknown-linux-gnu' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu | |
| - name: Build binary | |
| run: | | |
| if [[ "${{ matrix.target }}" == "aarch64-unknown-linux-gnu" ]]; then | |
| export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc | |
| export AR_aarch64_unknown_linux_gnu=aarch64-linux-gnu-ar | |
| fi | |
| cargo build --release --target ${{ matrix.target }} | |
| - name: Create archive | |
| shell: bash | |
| run: | | |
| binary_name="commitcraft${{ matrix.suffix }}" | |
| binary_path="target/${{ matrix.target }}/release/${binary_name}" | |
| if [[ "${{ runner.os }}" == "Windows" ]]; then | |
| archive_name="commitcraft-${{ matrix.target }}.zip" | |
| 7z a "$archive_name" "$binary_path" | |
| else | |
| archive_name="commitcraft-${{ matrix.target }}.tar.gz" | |
| tar -czf "$archive_name" -C "target/${{ matrix.target }}/release" "$binary_name" | |
| fi | |
| echo "ARCHIVE_NAME=$archive_name" >> $GITHUB_ENV | |
| echo "ARCHIVE_PATH=$archive_name" >> $GITHUB_ENV | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: ${{ env.ARCHIVE_NAME }} | |
| path: ${{ env.ARCHIVE_PATH }} | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| needs: [test, build-release] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v3 | |
| with: | |
| path: artifacts | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| draft: false | |
| prerelease: ${{ contains(github.ref, '-') }} | |
| files: artifacts/**/* | |
| generate_release_notes: true | |
| body: | | |
| ## 🚀 What's New | |
| This release includes various improvements and bug fixes. | |
| ## 📦 Installation | |
| ### Quick Install (Linux/macOS) | |
| ```bash | |
| curl -sSL https://raw.githubusercontent.com/san0808/commitcraft/main/install.sh | bash | |
| ``` | |
| ### Manual Download | |
| Download the appropriate binary for your platform from the assets below. | |
| ### Cargo Install | |
| ```bash | |
| cargo install commitcraft | |
| ``` | |
| ## 🎯 Usage | |
| ```bash | |
| # First time setup | |
| commitcraft setup | |
| # Generate commit message | |
| git add . | |
| commitcraft | |
| ``` | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| publish-crate: | |
| name: Publish to crates.io | |
| runs-on: ubuntu-latest | |
| needs: [test] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Publish to crates.io | |
| run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} |