ci: add build job with release artifact upload

Swadhin Biswas committed 7 months ago
78f08bb
1 parent b36bd37
commit 78f08bb
1 file changed
+27 -0
Showing 1 changed file+27-0
▼.github/workflows/ci.yml
+27-0
118
118
steps:
119
119
- uses: actions/checkout@v4
120
120
121
+ - name: Install Rust toolchain
122
+ uses: dtolnay/rust-toolchain@stable
123
+
124
+ - name: Cache cargo registry & build
125
+ uses: actions/cache@v4
126
+ with:
127
+ path: |
128
+ ~/.cargo/registry
129
+ ~/.cargo/git
130
+ target
131
+ key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
132
+ restore-keys: ${{ runner.os }}-cargo-build-
133
+
134
+ - name: Build release binary
135
+ run: cargo build --release --verbose
136
+
137
+ - name: Check binary size
138
+ run: |
139
+ ls -lh target/release/fetchx
140
+ echo "Binary size: $(du -h target/release/fetchx | cut -f1)"
141
+
142
+ - name: Upload binary artifact
143
+ uses: actions/upload-artifact@v4
144
+ with:
145
+ name: fetchx-${{ matrix.os }}
146
+ path: target/release/fetchx
147
+ retention-days: 7
121
148