From b0cb52f03c553fd75665809751254460cd052bd8 Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Thu, 13 Jul 2023 20:27:23 +0300 Subject: [PATCH] Upload complete source tarball as release asset Contrary to auto-generated release tarballs, this one includes all submodules such that operating system infrastructure gets a complete source tree wihtout having to fetch submodules themself. Add "-full" between name and version to distinguish the two tarballs. The token needs read/write permissions to clone the repository and upload assets to existing releases, respectively. Fixes #274 Signed-off-by: Klemens Nanni --- .github/workflows/release-tarball.yml | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/release-tarball.yml diff --git a/.github/workflows/release-tarball.yml b/.github/workflows/release-tarball.yml new file mode 100644 index 00000000..d5653824 --- /dev/null +++ b/.github/workflows/release-tarball.yml @@ -0,0 +1,35 @@ +name: Release Tarball + +on: + release: + types: [published] + +jobs: + upload-release-tarball: + name: upload complete source code for release + runs-on: ubuntu-latest + + steps: + - name: checkout tagged release recursively incl. submodules + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: set environment variables + run: | + NAME="${{ github.repository }}" + NAME="${NAME#*/}-full-${{ github.ref_name }}" + FILE="./${NAME}.tar.gz" + echo "NAME=${NAME}" >> "${GITHUB_ENV}" + echo "FILE=${FILE}" >> "${GITHUB_ENV}" + + - name: create compressed tarball with git-archive(1) + uses: qmonnet/git-archive-all-action@v1 + with: + prefix: ${{ format('{0}/', env.NAME) }} + output-files: ${{ env.FILE }} + + - name: upload static release asset + uses: svenstaro/upload-release-action@v2 + with: + file: ${{ env.FILE }}