From d5f5da4323aabb372c29a2a143dce8dc889a8301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 6 Sep 2021 11:47:49 +0200 Subject: [PATCH] workflows,release: Upload the vendored cargo code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As part of the release, let's also upload a tarball with the vendored cargo code. By doing this we allow distros, which usually don't have access to the internet while performing the builds, to just add the vendored code as a second source, making the life of the downstream maintainers slightly easier*. Fixes: #1203 Backports: #2573 *: The current workflow requires the downstream maintainer to download the tarball, unpack it, run `cargo vendor`, create the tarball, etc. Although this doesn't look like a ridiculous amount of work, it's better if we can have it in an automated fashion. Signed-off-by: Fabiano FidĂȘncio (cherry picked from commit 21c8511630fefecfcdc4af350ba25139dfac8fde) --- .github/workflows/release.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fc62d8083..16799bda4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -127,3 +127,21 @@ jobs: pushd $GITHUB_WORKSPACE echo "uploading asset '${tarball}' for tag: ${tag}" GITHUB_TOKEN=${{ secrets.GIT_UPLOAD_TOKEN }} hub release edit -m "" -a "${tarball}" "${tag}" + popd + + upload-cargo-vendored-tarball: + needs: upload-static-tarball + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: generate-and-upload-tarball + run: | + pushd $GITHUB_WORKSPACE/src/agent + cargo vendor >> .cargo/vendor + popd + tag=$(echo $GITHUB_REF | cut -d/ -f3-) + tarball="kata-containers-$tag-vendor.tar.gz" + pushd $GITHUB_WORKSPACE + tar -cvzf "${tarball}" src/agent/.cargo/vendor src/agent/vendor + GITHUB_TOKEN=${{ secrets.GIT_UPLOAD_TOKEN }} hub release edit -m "" -a "${tarball}" "${tag}" + popd