diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 0cea5a7..eb4fe1b 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -65,7 +65,22 @@ jobs: # release_name: Release ${{ github.ref }} # draft: false # prerelease: false + # 获取当前tag的版本 + - name: Get version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + # 从该tag打上一个release标签(这里会output一些参数 后面才能使用) + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.get_version.outputs.VERSION }} + release_name: ${{ steps.get_version.outputs.VERSION }} + draft: false + prerelease: false - name: Upload Release Asset uses: actions/upload-release-asset@v1 env: