From 216135386257ab89ce64207bbb073ac800f9e8a5 Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Fri, 3 Apr 2026 16:39:13 +0100 Subject: [PATCH] CI: Have the CI create a draft release on tag If you tag and push it to the TheList repository, a draft release will be generated that only the respository owner can see. They then have the opportunity to test, amend and maybe publish it. Note that the tag name will be used in someplaces such as the assert name for the zipfile / notes. --- .github/workflows/ci-build.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 433d8f0be..005d28f35 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -41,8 +41,40 @@ jobs: - name: Upload if: github.repository == 'LoopZ/TheList' && + github.ref_type != 'tag' && (github.event_name == 'push' || github.event.pull_request.merged == true) uses: actions/upload-artifact@v6 with: name: ${{ steps.snapshotname.outputs.fname }} path: TheList + + - name: Create release content + id: release + if: github.repository == 'LoopZ/TheList' && github.ref_type == 'tag' + run: | + version="${{ github.ref_type == 'tag' && github.ref_name }}" + release="TheList-${version}" + # + notes="${release}.md" + echo "" >> "$notes" + # + archive="${release}.zip" + zip --recurse-paths "${archive}" TheList + # + echo "version=$version" >>"$GITHUB_OUTPUT" + echo "archive=$archive" >>"$GITHUB_OUTPUT" + echo "notes=$notes" >>"$GITHUB_OUTPUT" + + - name: Create release + if: steps.release.outputs.version + run: | + gh release create \ + '${{ steps.release.outputs.version }}' \ + '${{ steps.release.outputs.archive }}' \ + --notes-file '${{ steps.release.outputs.notes }}' \ + --target '${{ github.sha }}' \ + --verify-tag \ + --fail-on-no-commits \ + --draft + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}