diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 22179ba4..0938c2fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -103,23 +103,33 @@ jobs: with: github-token: ${{ secrets.MOVE2KUBE_PATOKEN }} script: | + core.info('DEBUG 1'); const tag = '${{ github.event.inputs.tag }}'; const sha = '${{ steps.get_sha.outputs.sha }}'; + core.info('DEBUG 2'); let tag_exists = false; try { + core.info('DEBUG 3'); const resp = await github.git.getRef({...context.repo, ref: `tags/${tag}`}); tag_exists = true; core.info(`the tag ${tag} already exists on ${resp.data.object.type} ${resp.data.object.sha}`); } catch(err) { + core.info('DEBUG 4'); + core.info(`DEBUG 5 err.status ${err.status}`); if(err.status !== 404){ throw err; } + core.info('DEBUG 6'); } + core.info('DEBUG 7'); if(tag_exists) { + core.info('DEBUG 8'); core.info(`deleting the tag ${tag}`); const resp = await github.git.deleteRef({...context.repo, ref: `tags/${tag}`}); + core.info('DEBUG 9'); } + core.info('DEBUG 10'); core.info(`creating the tag ${tag} on the commit ${sha}`); github.git.createRef({ @@ -127,14 +137,18 @@ jobs: ref: `refs/tags/${tag}`, sha }); + core.info('DEBUG 11'); if(!tag.endsWith('-beta.0')) { + core.info('DEBUG 12'); return; } + core.info('DEBUG 13'); // create the release branch const major_minor = /^v(\d+\.\d+)/.exec(tag); if(!major_minor || major_minor.length !== 2){ return core.setFailed(`The tag is not a valid semantic version. tag: ${tag}`); } + core.info('DEBUG 14'); const branch_name = `release-${major_minor[1]}`; core.info(`New beta.0 release. Creating new branch for ${branch_name}`); github.git.createRef({ @@ -142,6 +156,7 @@ jobs: ref: `refs/heads/${branch_name}`, sha }); + core.info('DEBUG 15'); create_release_draft: needs: [tag]