From 2771227da5cfb9db48fd08ffcd42ad166b1b1939 Mon Sep 17 00:00:00 2001 From: Dominic Kempf Date: Mon, 11 Mar 2024 09:39:22 +0100 Subject: [PATCH] Try creating and pushing the tag --- .github/workflows/bump.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml index aee1176..84d6567 100644 --- a/.github/workflows/bump.yml +++ b/.github/workflows/bump.yml @@ -28,14 +28,27 @@ jobs: from packaging import version v = version.parse(setuptools_scm.get_version()) with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: - print(f'tag=v{v.major}.{v.minor + 1}.0', file=fh) + print(f'tag=v{v.major}.{v.minor}.{v.micro + 1}', file=fh) - name: Debug the next tag run: echo ${{ steps.get_next_tag.outputs.tag }} - - uses: rickstaa/action-create-tag@v1 - id: "tag_create" + - uses: actions/github-script@v7 with: - tag: ${{ steps.get_next_tag.outputs.tag }} + script: | + const newTag = await github.rest.git.createTag({ + context.repo.owner, + context.repo.repo, + tag: '${{ steps.get_next_tag.outputs.tag }}', + object: process.env.GITHUB_SHA as string, + type: 'commit', + }) + + const newReference = await github.rest.git.createRef({ + context.repo.owner, + context.repo.repo, + ref: `refs/tags/${newTag.data.tag}`, + sha: newTag.data.sha, + }) env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}