From 4da50c10c02cb9e26e64a00da2a2831c3cf05278 Mon Sep 17 00:00:00 2001 From: Lena <126529524+acuteenvy@users.noreply.github.com> Date: Fri, 12 Jan 2024 20:22:06 +0100 Subject: [PATCH] copy-release-assets: add workflow --- .github/workflows/copy-release-assets.yml | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/copy-release-assets.yml diff --git a/.github/workflows/copy-release-assets.yml b/.github/workflows/copy-release-assets.yml new file mode 100644 index 000000000..81780f665 --- /dev/null +++ b/.github/workflows/copy-release-assets.yml @@ -0,0 +1,31 @@ +name: Copy assets to the new release + +on: + release: + types: published + +permissions: + contents: write + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + release: + name: Copy assets to the new release + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Download and upload + run: | + LATEST="$(git describe --tags --abbrev=0)" + PREVIOUS="$(git describe --tags --abbrev=0 "$LATEST"^)" + + mkdir release-assets && cd release-assets + + gh release download "$PREVIOUS" + gh release upload "$LATEST" -- *