-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (123 loc) · 3.52 KB
/
Copy pathci.yml
File metadata and controls
130 lines (123 loc) · 3.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
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