diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 743285d34..de7abb1af 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,10 @@ on: - master workflow_dispatch: inputs: + version: + description: New version to create + required: false + default: "" channel: description: "Release channel" required: true @@ -19,7 +23,7 @@ jobs: semantic-release: runs-on: ubuntu-latest outputs: - release-version: ${{ steps.semantic.outputs.new_release_version }} + release-version: ${{ inputs.version == "" && steps.semantic.outputs.new_release_version || inputs.version }} new-release-published: ${{ steps.semantic.outputs.new-release-published }} steps: - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 @@ -36,12 +40,24 @@ jobs: fi echo "BRANCHES=$BRANCHES" >> $GITHUB_ENV - uses: cycjimmy/semantic-release-action@61680d0e9b02ff86f5648ade99e01be17f0260a4 # v4.0.0 + if: ${{ inputs.version == "" }} id: semantic with: branches: ${{ env.BRANCHES }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create tag + if: ${{ inputs.version != "" }} + uses: actions/github-script@v5 + with: + script: | + github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: 'refs/tags/${{ inputs.version }}', + sha: context.sha + }) binary: runs-on: ubuntu-latest needs: semantic-release