Compare commits
No commits in common. "main" and "2c691c9" have entirely different histories.
9 changed files with 556 additions and 792 deletions
2
.github/workflows/dev.yml
vendored
2
.github/workflows/dev.yml
vendored
|
@ -15,7 +15,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release --verbose
|
run: cargo build --release --verbose
|
||||||
- name: Run tests
|
- 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
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release --verbose
|
run: cargo build --release --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
@ -25,7 +25,7 @@ jobs:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release --verbose
|
run: cargo build --release --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
@ -37,7 +37,7 @@ jobs:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release --verbose
|
run: cargo build --release --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
|
128
.github/workflows/rust.yml
vendored
128
.github/workflows/rust.yml
vendored
|
@ -2,95 +2,99 @@ name: Rust -> Build & Test & Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["main"]
|
branches: [ "main" ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
PROJECT_NAME: ${{ github.event.repository.name }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_linux:
|
build_linux:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release --verbose
|
run: cargo build --release --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --verbose
|
run: cargo test --verbose
|
||||||
|
|
||||||
- name: Upload Linux Binary
|
- name: Upload Linux Binary
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ env.PROJECT_NAME }}-linux-x64_86
|
name: rust_tcp_file_transfer_linux_x64_86
|
||||||
path: target/release/${{ env.PROJECT_NAME }}
|
path: target/release/*transfer
|
||||||
|
|
||||||
build_windows:
|
build_windows:
|
||||||
|
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release --verbose
|
run: cargo build --release --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --verbose
|
run: cargo test --verbose
|
||||||
|
|
||||||
- name: Upload Windows Binary
|
- name: Upload Windows Binary
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ env.PROJECT_NAME }}-windows-x64_86
|
name: rust_tcp_file_transfer_windows_x64_86
|
||||||
path: target/release/${{ env.PROJECT_NAME }}.exe
|
path: target/release/*transfer.exe
|
||||||
|
|
||||||
build_macos:
|
build_macos:
|
||||||
|
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release --verbose
|
run: cargo build --release --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --verbose
|
run: cargo test --verbose
|
||||||
|
|
||||||
- name: Upload MacOS Binary
|
- name: Upload MacOS Binary
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ env.PROJECT_NAME }}-macos-arm64
|
name: rust_tcp_file_transfer_macos_x64_86
|
||||||
path: target/release/${{ env.PROJECT_NAME }}
|
path: target/release/*transfer
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [build_linux, build_windows, build_macos]
|
needs: [build_linux, build_windows, build_macos]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Forge a Folder
|
|
||||||
run: mkdir Downloads
|
|
||||||
working-directory: /home/runner/work/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}/
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/checkout@v3
|
||||||
name: Download
|
- name: Forge a Folder
|
||||||
with:
|
run: mkdir Downloads
|
||||||
path: Downloads/
|
working-directory: /home/runner/work/rust-tcp-file-transfer/rust-tcp-file-transfer/
|
||||||
|
|
||||||
- name: Rename Binaries
|
- uses: actions/download-artifact@v3
|
||||||
run: |
|
name: Download
|
||||||
tree Downloads/
|
with:
|
||||||
mv Downloads/${{ env.PROJECT_NAME }}-linux-x64_86/${{ env.PROJECT_NAME }} Downloads/${{ env.PROJECT_NAME }}-linux-x64_86/${{ env.PROJECT_NAME }}-linux-x64_86
|
path: Downloads/
|
||||||
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: Rename Binaries
|
||||||
- name: Git Commit SHA
|
run: |
|
||||||
id: vars
|
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
|
||||||
run: |
|
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
|
||||||
calculatedSha=$(git rev-parse --short ${{ github.sha }})
|
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
|
||||||
echo "short_sha=$calculatedSha" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v2
|
- name: Git Commit SHA
|
||||||
name: Release
|
id: vars
|
||||||
with:
|
run: |
|
||||||
tag_name: ${{ steps.vars.outputs.short_sha }}
|
calculatedSha=$(git rev-parse --short ${{ github.sha }})
|
||||||
generate_release_notes: true
|
echo "short_sha=$calculatedSha" >> $GITHUB_OUTPUT
|
||||||
files: |
|
|
||||||
Downloads/*linux*/${{ env.PROJECT_NAME }}*
|
- uses: softprops/action-gh-release@v0.1.15
|
||||||
Downloads/*windows*/${{ env.PROJECT_NAME }}*
|
name: Release
|
||||||
Downloads/*macos*/${{ env.PROJECT_NAME }}*
|
with:
|
||||||
|
tag_name: ${{ steps.vars.outputs.short_sha }}
|
||||||
|
generate_release_notes: true
|
||||||
|
files: |
|
||||||
|
Downloads/*linux*/*transfer*
|
||||||
|
Downloads/*windows*/*transfer*
|
||||||
|
Downloads/*macos*/*transfer*
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,7 +2,6 @@
|
||||||
# will have compiled files and executables
|
# will have compiled files and executables
|
||||||
debug/
|
debug/
|
||||||
target/
|
target/
|
||||||
.vscode/
|
|
||||||
|
|
||||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
# 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
|
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
||||||
|
|
|
@ -8,10 +8,6 @@ strip = "symbols"
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
overflow-checks = true
|
overflow-checks = true
|
||||||
lto = true
|
lto = true
|
||||||
codegen-units = 1
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
panic = "abort"
|
|
||||||
|
|
||||||
[lints.rust]
|
|
||||||
unsafe_code = "forbid"
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
25
README.md
25
README.md
|
@ -2,25 +2,16 @@
|
||||||
# rust-tcp-file-transfer
|
# rust-tcp-file-transfer
|
||||||
TCP File Transfer Server and Client in Rust
|
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.
|
☑ File transfer over network.
|
||||||
|
|
||||||
☑ Remove memory limitations. [d42412c](https://github.com/Tahinli/rust-tcp-file-transfer/pull/1/commits/d42412c57d7d95672ba64b3e489b95f1c4b04a08)
|
☑ Remove memory limitations. [d42412c](https://github.com/Tahinli/rust-tcp-file-transfer/pull/1/commits/d42412c57d7d95672ba64b3e489b95f1c4b04a08)
|
||||||
|
|
||||||
☑ Bidirectional transfer. [b0531de](https://github.com/Tahinli/rust-tcp-file-transfer/commit/b0531deb257332f46fc76de16d3a17fb3b28acee)
|
☑ Bidirectional transfer. [b0531de](https://github.com/Tahinli/rust-tcp-file-transfer/commit/b0531deb257332f46fc76de16d3a17fb3b28acee)
|
||||||
|
|
||||||
|
☐ Folder transfer.
|
||||||
|
|
||||||
|
☐ Remember where it stopped.
|
||||||
|
|
||||||
|
☐ Reach over NAT (peer to peer).
|
||||||
|
|
||||||
|
☐ Async.
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 281 KiB |
Binary file not shown.
Before Width: | Height: | Size: 28 KiB |
1180
src/main.rs
1180
src/main.rs
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue