From 5461c67a08b3f81ae9470865a00b82febd630813 Mon Sep 17 00:00:00 2001 From: Christian Zangl Date: Sun, 14 Jan 2024 17:46:55 +0100 Subject: [PATCH] gh-publish --- .github/workflows/build.yml | 79 +++++++++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 8 ++-- .gitignore | 2 + README.md | 14 ++++--- 4 files changed, 94 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..fd74807 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,79 @@ + +name: build + +on: [push] + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: prep + shell: bash + run: | + python -m pip install --upgrade pip + python -m pip install pyinstaller==6.3.0 + rm -rf build dist + + - name: build + shell: bash + run: | + echo "RUNNER_OS: $RUNNER_OS" + pyinstaller rsyncy.py --onefile --name rsyncy --console + cat build/rsyncy/warn-rsyncy.txt + cd dist; ls -l + if [ "$RUNNER_OS" == "Linux" ]; then + tar -czf rsyncy-linux_amd64.tar.gz rsyncy + elif [ "$RUNNER_OS" == "macOS" ]; then + tar -czf rsyncy-macos_amd64.tar.gz rsyncy + else + echo 'unknown runner' + exit 1 + fi + + - name: artifact + uses: actions/upload-artifact@v4 + if: runner.os == 'Linux' + with: + name: binary-${{ matrix.os }} + path: dist/rsyncy*.tar.gz + + - name: artifact + uses: actions/upload-artifact@v4 + if: runner.os == 'macOS' + with: + name: binary-${{ matrix.os }} + path: dist/rsyncy*.tar.gz + + + publish: + runs-on: ubuntu-latest + needs: build + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + + steps: + - name: get-artifacts + uses: actions/download-artifact@v4 + with: + path: dist + merge-multiple: true + - name: list + shell: bash + run: | + find + ls -l dist + - name: publish-release + uses: softprops/action-gh-release@v1 + with: + draft: true + files: dist/* + diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 700f867..7758f98 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,5 +1,5 @@ -name: Lint +name: lint on: [push, pull_request] @@ -7,6 +7,8 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' - uses: psf/black@stable diff --git a/.gitignore b/.gitignore index f795a48..ad84186 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ dist/ *.egg-info/ *.pyc _* +build +rsyncy.spec diff --git a/README.md b/README.md index 5e79ec0..14b0bb9 100644 --- a/README.md +++ b/README.md @@ -34,14 +34,12 @@ Workaround: connect once to your server via ssh to add it to the known_hosts fil ## Installation -``` -pip3 install --user rsyncy +Download: You can download a release directly from [github releases](https://github.com/laktak/rsyncy/releases). -# or if you have pipx -pipx install rsyncy -``` +If you OS/platform is not yet supported you can also use either [pipx](https://pipx.pypa.io/latest/installation/) or pip: -Minimum Python version is 3.6. +- `pipx install rsyncy` +- `pip install --user rsyncy` On macOS you also need to `brew install rsync` because it ships with an rsync from 2006. @@ -65,7 +63,9 @@ $ rsync -a --info=progress2 -hv FROM/ TO | rsyncy At the moment `rsyncy` itself has only one option, you can turn off colors via the `NO_COLOR=1` environment variable. +## Known Issues when using ssh behind rsync +ssh uses direct TTY access to make sure that the password is indeed issued by an interactive keyboard user. rsyncy is unable to detect the password prompt and will overwrite it with the status line. You can still enter your password and press enter to continue. ## lf support @@ -87,6 +87,8 @@ cmd paste-rsync %{{ This shows the copy progress in the `>` line while rsync is running. +If you have downloaded the binary version you can create it with `ln -s rsyncy rsyncy-stat`. + ## Development First record an rsync transfer with [pipevcr](https://github.com/laktak/pipevcr), then replay it to rsyncy when debugging.