diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c4db03913..a0dc66a87 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -402,6 +402,7 @@ jobs: with: files: assets/*.zip tag_name: ${{ needs.meta.outputs.tag }} + prerelease: ${{ needs.meta.outputs.is_pre_release }} - name: Create issue if failed to publish packages if: steps.nuget.outputs.failed || steps.pip.outputs.failed diff --git a/.github/workflows/meta.yml b/.github/workflows/meta.yml index 071a72234..c8c780d30 100644 --- a/.github/workflows/meta.yml +++ b/.github/workflows/meta.yml @@ -5,6 +5,8 @@ on: outputs: is_release: value: ${{ jobs.set.outputs.is_release }} + is_pre_release: + value: ${{ jobs.set.outputs.is_pre_release }} tag: value: ${{ jobs.set.outputs.tag }} version: @@ -20,6 +22,7 @@ jobs: - id: set run: | is_release=${{ startsWith(github.ref, 'refs/tags/v') }} + is_pre_release=${{ contains(github.ref, '-alpha.') || contains(github.ref, '-beta.') || contains(github.ref, '-rc.') }} commit_hash=$(git rev-parse --short HEAD) if $is_release; then @@ -50,10 +53,13 @@ jobs: is_release=$is_release" | tee -a "$GITHUB_OUTPUT" outputs: is_release: ${{ steps.set.outputs.is_release }} + is_pre_release: ${{ steps.set.outputs.is_pre_release }} tag: ${{ steps.set.outputs.tag }} # v | v version: ${{ steps.set.outputs.version }} # | + e.g ↓ - # 主版本号.次版本号.修订号[-(alpha|beta|rc).预发布号] - # [-post.发布后号[-ci.${{ github.run_id }}]+${commit_hash}.${dateY%m%d}] - # 1.7.0 - # 1.7.0-beta.1 - # 1.7.0-post.6-ci.8678478007+gf5e12a1c.20240413 + + + # 主版本号.次版本号.修订号[-(alpha|beta|rc).预发布号] + # [-post.发布后号[-ci.${{ github.run_id }}]+${commit_hash}.${dateY%m%d}] + # 1.7.0 + # 1.7.0-beta.1 + # 1.7.0-post.6-ci.8678478007+gf5e12a1c.20240413