name: CI on: push: branches: [main] pull_request: branches: [main] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Rust run: | rustup install stable rustup default stable - name: Install system dependencies run: | apt-get update apt-get install -y --no-install-recommends libssl-dev libssh2-1-dev pkg-config cmake - name: Cache dependencies uses: actions/cache@v3 with: path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo- - name: Build run: cargo build --features full - name: Run tests run: cargo test --features full - name: Run clippy run: cargo clippy --features full -- -D warnings - name: Check formatting run: cargo fmt --check release: needs: test runs-on: ubuntu-latest if: startsWith(gitea.ref, 'refs/tags/v') steps: - uses: actions/checkout@v4 - name: Setup Rust run: | rustup install stable rustup default stable - name: Install system dependencies run: | apt-get update apt-get install -y --no-install-recommends libssl-dev libssh2-1-dev pkg-config cmake - name: Build release run: cargo build --release --features full - name: Create Release run: | curl -X POST "${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases" \ -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ -H "Content-Type: application/json" \ -d '{ "tag_name": "${{ gitea.ref_name }}", "name": "${{ gitea.ref_name }}", "body": "Release ${{ gitea.ref_name }}" }' env: GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}