Update connection.rs #13
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 | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: "-D warnings" | |
| jobs: | |
| fmt: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt --check | |
| audit: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: cargo install cargo-audit --locked || true | |
| - run: cargo audit | |
| clippy: | |
| name: Clippy | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: clippy-${{ runner.os }}-${{ hashFiles('Cargo.lock') }} | |
| restore-keys: clippy-${{ runner.os }}- | |
| - run: cargo clippy -- -W clippy::pedantic -W clippy::nursery -D warnings | |
| build: | |
| name: Build (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, ubuntu-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: build-${{ runner.os }}-${{ hashFiles('Cargo.lock') }} | |
| restore-keys: build-${{ runner.os }}- | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libxdo-dev libdbus-1-dev | |
| - run: cargo build --release | |
| - name: Upload binary | |
| if: runner.os == 'Windows' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: adb-ui-rs-windows | |
| path: target/release/adb-ui-rs.exe | |
| - name: Upload binary (Linux) | |
| if: runner.os == 'Linux' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: adb-ui-rs-linux | |
| path: target/release/adb-ui-rs | |
| release: | |
| name: Release | |
| needs: [fmt, clippy, audit, build] | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| runs-on: windows-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: release-${{ runner.os }}-${{ hashFiles('Cargo.lock') }} | |
| restore-keys: release-${{ runner.os }}- | |
| - run: cargo build --release | |
| - name: Create default config | |
| shell: bash | |
| run: | | |
| cat > target/release/adb-ui-rs.json << 'EOF' | |
| { | |
| "bundle_id": "com.appname.app", | |
| "logcat_tags": [ | |
| "SDL", | |
| "SDL/APP", | |
| "GameActivity", | |
| "NativeCrashReporter" | |
| ] | |
| } | |
| EOF | |
| - name: Package | |
| shell: bash | |
| run: | | |
| cd target/release | |
| 7z a ../../adb-ui-rs-${{ github.ref_name }}-windows-x64.zip adb-ui-rs.exe adb-ui-rs.json | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: adb-ui-rs-${{ github.ref_name }}-windows-x64.zip | |
| generate_release_notes: true |