From 3194678007eb332c2b72d8dadee7af8d95c56151 Mon Sep 17 00:00:00 2001 From: Lutz Justen Date: Wed, 1 Feb 2023 09:31:48 +0100 Subject: [PATCH] [Release] Include docs and cdc_rsync_server.exe in zip (#70) Also clarifies some unclear aspects in the readme, and adds a fix that allows create_release.yml to be used for pull requests for testing. Fixes #67 Fixes #55 --- .github/workflows/create_release.yml | 8 +++++++- README.md | 24 ++++++++++++------------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 3abacf9..5b40020 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -98,10 +98,13 @@ jobs: - name: Copy artifacts run: | mkdir artifacts + mkdir artifacts\docs cp bazel-bin/cdc_rsync/cdc_rsync.exe artifacts + cp bazel-bin/cdc_rsync_server/cdc_rsync_server.exe artifacts cp bazel-bin/cdc_stream/cdc_stream.exe artifacts cp LICENSE artifacts cp README.md artifacts + cp docs\* artifacts\docs - name: Upload artifacts uses: actions/upload-artifact@v3 @@ -119,7 +122,10 @@ jobs: - name: Zip binaries run: | # The ref resolves to "main" for latest and e.g. "v0.1.0" for tagged. - BINARIES_ZIP_NAME=cdc-file-transfer-binaries-${GITHUB_REF#refs/*/}-x64.zip + REF=${GITHUB_REF#refs/*/} + # For pull requests, this is e.g. '70/merge', so replace / with -. + REF=${REF/\//-} + BINARIES_ZIP_NAME=cdc-file-transfer-binaries-$REF-x64.zip echo "BINARIES_ZIP_NAME=$BINARIES_ZIP_NAME" >> $GITHUB_ENV zip -j $BINARIES_ZIP_NAME Windows-Artifacts/* Linux-Artifacts/* diff --git a/README.md b/README.md index 388ebd8..94837f5 100644 --- a/README.md +++ b/README.md @@ -192,15 +192,17 @@ remote syncs is being added, see # Getting Started Download the precompiled binaries from the -[latest release](https://github.com/google/cdc-file-transfer/releases). -We currently provide Linux binaries compiled on +[latest release](https://github.com/google/cdc-file-transfer/releases) to a +Windows device and unzip them. The Linux binaries are automatically deployed +to `~/.cache/cdc-file-transfer` by the Windows tools. There is no need to manually +deploy them. We currently provide Linux binaries compiled on [Github's latest Ubuntu](https://github.com/actions/runner-images) version. If the binaries work for you, you can skip the following two sections. Alternatively, the project can be built from source. Some binaries have to be built on Windows, some on Linux. -## Prerequisites +## Prerequisites for Building To build the tools from source, the following steps have to be executed on **both Windows and Linux**. @@ -223,35 +225,33 @@ The file transfer tools require `ssh.exe` and `sftp.exe`. ## Building -The two tools can be built and used independently. +The two tools CDC RSync and CDC Stream can be built and used independently. ### CDC RSync -* Build Linux components +* On a Linux device, build the Linux components ``` bazel build --config linux --compilation_mode=opt --linkopt=-Wl,--strip-all --copt=-fdata-sections --copt=-ffunction-sections --linkopt=-Wl,--gc-sections //cdc_rsync_server ``` -* Build Windows components +* On a Windows device, build the Windows components ``` bazel build --config windows --compilation_mode=opt --copt=/GL //cdc_rsync ``` * Copy the Linux build output file `cdc_rsync_server` from - `bazel-bin/cdc_rsync_server` on the Linux system to `bazel-bin\cdc_rsync` - on the Windows machine. + `bazel-bin/cdc_rsync_server` to `bazel-bin\cdc_rsync` on the Windows machine. ### CDC Stream -* Build Linux components +* On a Linux device, build the Linux components ``` bazel build --config linux --compilation_mode=opt --linkopt=-Wl,--strip-all --copt=-fdata-sections --copt=-ffunction-sections --linkopt=-Wl,--gc-sections //cdc_fuse_fs ``` -* Build Windows components +* On a Windows device, build the Windows components ``` bazel build --config windows --compilation_mode=opt --copt=/GL //cdc_stream ``` * Copy the Linux build output files `cdc_fuse_fs` and `libfuse.so` from - `bazel-bin/cdc_fuse_fs` on the Linux system to `bazel-bin\cdc_stream` - on the Windows machine. + `bazel-bin/cdc_fuse_fs` to `bazel-bin\cdc_stream` on the Windows machine. ## Usage