diff --git a/.github/workflows/release-whl-kernel.yml b/.github/workflows/release-whl-kernel.yml index 1b2efaad7..08a820c2a 100644 --- a/.github/workflows/release-whl-kernel.yml +++ b/.github/workflows/release-whl-kernel.yml @@ -4,8 +4,12 @@ on: workflow_dispatch: inputs: tag_name: - required: true type: string + push: + branches: + - main + paths: + - sgl-kernel/version.py jobs: build-wheels: @@ -51,10 +55,20 @@ jobs: merge-multiple: true pattern: wheel-* + - name: Set tag name + id: set_tag_name + run: | + if [ -z "${{ inputs.tag_name }}" ]; then + TAG_NAME="v$(cat sgl-kernel/version.py | cut -d'"' -f2)" + echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT + else + echo "tag_name=${{ inputs.tag_name }}" >> $GITHUB_OUTPUT + fi + - name: Release uses: softprops/action-gh-release@v2 with: - tag_name: ${{ inputs.tag_name }} + tag_name: ${{ steps.set_tag_name.outputs.tag_name }} repository: sgl-project/whl token: ${{ secrets.WHL_TOKEN }} files: |