From a8afe394379adea8cf4406792bff66425f791be4 Mon Sep 17 00:00:00 2001 From: Moshe Immerman Date: Fri, 11 Oct 2024 14:44:09 +0300 Subject: [PATCH] chore: fix release pipeline [skip ci] --- .github/workflows/release.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c62b60613..515be1e29 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,12 @@ jobs: run: | if [[ "${{ inputs.version }}" != "" ]]; then echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV - elif [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then + echo "TAG=v${{ inputs.version }}" >> $GITHUB_ENV + else + echo "VERSION=" >> $GITHUB_ENV + fi + + if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then if [[ "${{ inputs.channel }}" == "stable" ]]; then BRANCHES="['master']" elif [[ "${{ inputs.channel }}" == "rc" ]]; then @@ -41,8 +46,9 @@ jobs: BRANCHES="[{name: 'master', channel: 'beta', prerelease: 'beta'}, {name: 'dummy-release'}]" fi echo "BRANCHES=$BRANCHES" >> $GITHUB_ENV + cat $GITHUB_ENV - uses: cycjimmy/semantic-release-action@61680d0e9b02ff86f5648ade99e01be17f0260a4 # v4.0.0 - if: ${{ inputs.version }} == '' + if: ${{ ! env.TAG }} id: semantic with: branches: ${{ env.BRANCHES }} @@ -50,14 +56,14 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create tag - if: ${{ inputs.version }} != '' + if: ${{ env.TAG }} uses: actions/github-script@v5 with: script: | github.rest.git.createRef({ owner: context.repo.owner, repo: context.repo.repo, - ref: 'refs/tags/v${{ inputs.version }}', + ref: 'refs/tags/${{ env.TAG }}', sha: context.sha }) binary: