@@ -45,52 +45,41 @@ jobs:
4545 steps :
4646 - name : Check out the repo
4747 uses : actions/checkout@v4
48+ with :
49+ ref : ${{ github.head_ref }} # checkout the correct branch name
50+ fetch-depth : 0
4851
4952 - name : Extract current version
5053 id : pyproject_version
5154 run : |
5255 TAG=v$(grep 'version =' pyproject.toml | sed -e 's/version = "\(.*\)"/\1/')
5356 echo "TAG=$TAG" >> "$GITHUB_OUTPUT"
5457
55- - name : Semantic Release
56- uses : cycjimmy/semantic-release-action@v4
58+ - name : Get tag version
5759 id : semantic_release
58- with :
59- ci : false
60- dry_run : true
61- branches : |
62- [
63- '+([0-9])?(.{+([0-9]),x}).x',
64- 'main',
65- {
66- name: 'beta',
67- prerelease: true
68- },
69- {
70- name: 'alpha',
71- prerelease: true
72- },
73- {
74- name: 'feat-k8s-deploy',
75- prerelease: true
76- }
77- ]
60+ uses :
anothrNick/[email protected] 7861 env :
7962 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
80-
63+ WITH_V : true
64+ DEFAULT_BUMP : " patch"
65+ TAG_CONTEXT : ' repo'
66+ PRERELEASE_SUFFIX : " beta"
67+ PRERELEASE : true
68+ DRY_RUN : true
69+
8170 - name : Compare versions
8271 run : |
8372 echo "Current version: ${{ steps.pyproject_version.outputs.TAG }}"
84- echo "New version: ${{ steps.semantic_release.outputs.new_release_version }}"
85- if [ "${{ steps.pyproject_version.outputs.TAG }}" != "${{ steps.semantic_release.outputs.new_release_version }}" ]; then
73+ echo "New version: ${{ steps.semantic_release.outputs.tag }}"
74+ if [ "${{ steps.pyproject_version.outputs.TAG }}" != "${{ steps.semantic_release.outputs.tag }}" ]; then
8675 echo "### Version mismatch detected! :warning:
8776 Current version: ${{ steps.pyproject_version.outputs.TAG }}
88- New version: **${{ steps.semantic_release.outputs.new_release_version }}**
77+ New version: **${{ steps.semantic_release.outputs.tag }}**
8978 Please update the version in pyproject.toml." >> $GITHUB_STEP_SUMMARY
9079 exit 1
9180 else
9281 echo "### Version match confirmed! :rocket:
9382 Current version: ${{ steps.pyproject_version.outputs.TAG }}
94- New version: **${{ steps.semantic_release.outputs.new_release_version }}**
83+ New version: **${{ steps.semantic_release.outputs.tag }}**
9584 The version is up-to-date." >> $GITHUB_STEP_SUMMARY
9685 fi
0 commit comments