Compare commits
49 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
db3d864de0 | ||
![]() |
93a5e9b5ca | ||
![]() |
df91279e6e | ||
![]() |
8716833ac4 | ||
![]() |
4b0423bc68 | ||
![]() |
96cfc0ad9b | ||
![]() |
346f297f12 | ||
![]() |
8861f81f06 | ||
![]() |
f20fbe83b6 | ||
![]() |
99ba75f6b1 | ||
![]() |
569c5ea566 | ||
![]() |
264367572a | ||
![]() |
74b7646d64 | ||
![]() |
190655c44f | ||
![]() |
3344c18ef2 | ||
![]() |
9360f06917 | ||
![]() |
f08d277267 | ||
![]() |
1c14a81e18 | ||
![]() |
a3ccc63d37 | ||
![]() |
631c41b171 | ||
![]() |
6e2fb6eae7 | ||
![]() |
629caef9e9 | ||
![]() |
a48f8760e4 | ||
![]() |
3ee173f8f3 | ||
![]() |
b4ab4e2f18 | ||
![]() |
e1e94ed2c4 | ||
![]() |
39172488d2 | ||
![]() |
384e460bc2 | ||
![]() |
0a6a1efc5f | ||
![]() |
ccc2dbc547 | ||
![]() |
59c2997dc2 | ||
![]() |
0655c968d0 | ||
![]() |
217961e18b | ||
![]() |
a962fb83b6 | ||
![]() |
06b27b4585 | ||
![]() |
bea5b1d6d9 | ||
![]() |
2c691c9161 | ||
![]() |
572a70a3ba | ||
![]() |
3ccd30d007 | ||
![]() |
f1ce7811f9 | ||
![]() |
9d0d834439 | ||
![]() |
327a57cbc7 | ||
![]() |
d5d0f31212 | ||
![]() |
b0531deb25 | ||
![]() |
864140da97 | ||
![]() |
24a181c856 | ||
![]() |
cfbb7e5198 | ||
![]() |
f382b04bfe | ||
![]() |
ceaae91d6f |
9 changed files with 811 additions and 558 deletions
2
.github/workflows/dev.yml
vendored
2
.github/workflows/dev.yml
vendored
|
@ -15,7 +15,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
run: cargo build --release --verbose
|
||||
- name: Run tests
|
||||
|
|
6
.github/workflows/pr_main.yml
vendored
6
.github/workflows/pr_main.yml
vendored
|
@ -13,7 +13,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
run: cargo build --release --verbose
|
||||
- name: Run tests
|
||||
|
@ -25,7 +25,7 @@ jobs:
|
|||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
run: cargo build --release --verbose
|
||||
- name: Run tests
|
||||
|
@ -37,7 +37,7 @@ jobs:
|
|||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
run: cargo build --release --verbose
|
||||
- name: Run tests
|
||||
|
|
54
.github/workflows/rust.yml
vendored
54
.github/workflows/rust.yml
vendored
|
@ -2,62 +2,60 @@ name: Rust -> Build & Test & Release
|
|||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
branches: ["main"]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
PROJECT_NAME: ${{ github.event.repository.name }}
|
||||
|
||||
jobs:
|
||||
build_linux:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
run: cargo build --release --verbose
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
||||
|
||||
- name: Upload Linux Binary
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: rust_tcp_file_transfer_linux_x64_86
|
||||
path: target/release/*transfer
|
||||
name: ${{ env.PROJECT_NAME }}-linux-x64_86
|
||||
path: target/release/${{ env.PROJECT_NAME }}
|
||||
|
||||
build_windows:
|
||||
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
run: cargo build --release --verbose
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
||||
|
||||
- name: Upload Windows Binary
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: rust_tcp_file_transfer_windows_x64_86
|
||||
path: target/release/*transfer.exe
|
||||
name: ${{ env.PROJECT_NAME }}-windows-x64_86
|
||||
path: target/release/${{ env.PROJECT_NAME }}.exe
|
||||
|
||||
build_macos:
|
||||
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
run: cargo build --release --verbose
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
||||
|
||||
- name: Upload MacOS Binary
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: rust_tcp_file_transfer_macos_x64_86
|
||||
path: target/release/*transfer
|
||||
name: ${{ env.PROJECT_NAME }}-macos-arm64
|
||||
path: target/release/${{ env.PROJECT_NAME }}
|
||||
|
||||
release:
|
||||
needs: [build_linux, build_windows, build_macos]
|
||||
|
@ -65,36 +63,34 @@ jobs:
|
|||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Forge a Folder
|
||||
run: mkdir Downloads
|
||||
working-directory: /home/runner/work/rust-tcp-file-transfer/rust-tcp-file-transfer/
|
||||
working-directory: /home/runner/work/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}/
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
- uses: actions/download-artifact@v4
|
||||
name: Download
|
||||
with:
|
||||
path: Downloads/
|
||||
|
||||
- name: Rename Binaries
|
||||
run: |
|
||||
mv Downloads/rust_tcp_file_transfer_linux_x64_86/rust-tcp-file-transfer Downloads/rust_tcp_file_transfer_linux_x64_86/rust-tcp-file-transfer-linux_x64_86
|
||||
mv Downloads/rust_tcp_file_transfer_windows_x64_86/rust-tcp-file-transfer.exe Downloads/rust_tcp_file_transfer_windows_x64_86/rust-tcp-file-transfer-windows_x64_86.exe
|
||||
mv Downloads/rust_tcp_file_transfer_macos_x64_86/rust-tcp-file-transfer Downloads/rust_tcp_file_transfer_macos_x64_86/rust-tcp-file-transfer-macos_x64_86
|
||||
|
||||
tree Downloads/
|
||||
mv Downloads/${{ env.PROJECT_NAME }}-linux-x64_86/${{ env.PROJECT_NAME }} Downloads/${{ env.PROJECT_NAME }}-linux-x64_86/${{ env.PROJECT_NAME }}-linux-x64_86
|
||||
mv Downloads/${{ env.PROJECT_NAME }}-windows-x64_86/${{ env.PROJECT_NAME }}.exe Downloads/${{ env.PROJECT_NAME }}-windows-x64_86/${{ env.PROJECT_NAME }}-windows-x64_86.exe
|
||||
mv Downloads/${{ env.PROJECT_NAME }}-macos-arm64/${{ env.PROJECT_NAME }} Downloads/${{ env.PROJECT_NAME }}-macos-arm64/${{ env.PROJECT_NAME }}-macos-arm64
|
||||
- name: Git Commit SHA
|
||||
id: vars
|
||||
run: |
|
||||
calculatedSha=$(git rev-parse --short ${{ github.sha }})
|
||||
echo "short_sha=$calculatedSha" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: softprops/action-gh-release@v0.1.15
|
||||
- uses: softprops/action-gh-release@v2
|
||||
name: Release
|
||||
with:
|
||||
tag_name: ${{ steps.vars.outputs.short_sha }}
|
||||
generate_release_notes: true
|
||||
files: |
|
||||
Downloads/*linux*/*transfer*
|
||||
Downloads/*windows*/*transfer*
|
||||
Downloads/*macos*/*transfer*
|
||||
|
||||
Downloads/*linux*/${{ env.PROJECT_NAME }}*
|
||||
Downloads/*windows*/${{ env.PROJECT_NAME }}*
|
||||
Downloads/*macos*/${{ env.PROJECT_NAME }}*
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,6 +2,7 @@
|
|||
# will have compiled files and executables
|
||||
debug/
|
||||
target/
|
||||
.vscode/
|
||||
|
||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
||||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
||||
|
|
11
Cargo.toml
11
Cargo.toml
|
@ -3,6 +3,15 @@ name = "rust-tcp-file-transfer"
|
|||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
[profile.release]
|
||||
strip = "symbols"
|
||||
opt-level = 3
|
||||
overflow-checks = true
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = "abort"
|
||||
|
||||
[lints.rust]
|
||||
unsafe_code = "forbid"
|
||||
|
||||
[dependencies]
|
||||
|
|
27
README.md
27
README.md
|
@ -2,16 +2,25 @@
|
|||
# rust-tcp-file-transfer
|
||||
TCP File Transfer Server and Client in Rust
|
||||
|
||||
**Usage**
|
||||
> ./rust-tcp-file-transfer -h
|
||||
>
|
||||
<img src=assets/help_menu.png>
|
||||
|
||||
|
||||
**Examples**
|
||||
> ./rust-tcp-file-transfer -sv -s -l ~/Desktop/cat.png
|
||||
>
|
||||
> ./rust-tcp-file-transfer -cl -r -l ~/Documents/
|
||||
|
||||
<img src=assets/example.png>
|
||||
|
||||
**TO-DO List**
|
||||
|
||||
☑ Standard library only.
|
||||
|
||||
☑ File transfer over network.
|
||||
|
||||
☑ Remove memory limitations. [d42412c](https://github.com/Tahinli/rust-tcp-file-transfer/pull/1/commits/d42412c57d7d95672ba64b3e489b95f1c4b04a08)
|
||||
|
||||
☐ Bidirectional transfer.
|
||||
|
||||
☐ Folder transfer.
|
||||
|
||||
☐ Remember where it stopped.
|
||||
|
||||
☐ Reach over NAT (peer to peer).
|
||||
|
||||
☐ Async.
|
||||
☑ Bidirectional transfer. [b0531de](https://github.com/Tahinli/rust-tcp-file-transfer/commit/b0531deb257332f46fc76de16d3a17fb3b28acee)
|
||||
|
|
BIN
assets/example.png
Normal file
BIN
assets/example.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 281 KiB |
BIN
assets/help_menu.png
Normal file
BIN
assets/help_menu.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
1096
src/main.rs
1096
src/main.rs
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue