diff --git a/.github/workflows/build-push-tag.yml b/.github/workflows/build-push-tag.yml index 6019891..04b76fe 100644 --- a/.github/workflows/build-push-tag.yml +++ b/.github/workflows/build-push-tag.yml @@ -80,3 +80,23 @@ jobs: docker push ${GHCR_PREFIX}/${REGISTRY_IMAGE}:${docker_image}-${{ github.ref_name }} docker push ${DOCKER_HUB_PREFIX}/${REGISTRY_IMAGE}:${docker_image}-${{ github.ref_name }} done + + # Copied and modified from k0sctl: https://github.com/k0sproject/k0sctl/blob/main/.github/workflows/release.yaml + ## Ugly hack to get the tag name + ## github.ref gives the full reference like refs.tags.v0.0.1-beta1 + - name: Get branch name to draft release + if: ${{ inputs.tag }} + id: branch_name + run: | + echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> ${GITHUB_OUTPUT} + + - name: Draft release + if: ${{ inputs.tag }} + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + body: "${{ steps.branch_name.outputs.TAG_NAME }}" + tag_name: ${{ steps.branch_name.outputs.TAG_NAME }} + name: ${{ steps.branch_name.outputs.TAG_NAME }} + draft: true # So we can manually edit before publishing + prerelease: false