@@ -2,7 +2,8 @@ name: Release
22
33on :
44 push :
5- paths : project.toml
5+ tags :
6+ - " v*"
67
78permissions :
89 contents : write
@@ -13,48 +14,11 @@ jobs:
1314 steps :
1415 - name : Checkout
1516 uses : actions/checkout@v4
16- with :
17- fetch-depth : 0
18- ref : ${{ github.ref }}
19-
20- - name : Setup python
21- uses : actions/setup-python@v5
22- with :
23- python-version : " 3.11"
24-
25- - name : Read version from project config
26- id : read_toml
27- uses : SebRollen/toml-action@v1.0.2
28- with :
29- file : project.toml
30- field : project.version
31-
32- # - name: Replace template
33- # run: python3 scripts/replace-template.py
34-
35- # - name: Commit changes
36- # uses: EndBug/add-and-commit@v7
37- # with:
38- # message: "[Release] ${{ steps.read_toml.outputs.value }}"
39- # pull_strategy: "NO-PULL"
40- # push: false
41- #
42- # - name: Push changes
43- # run: |
44- # git pull --rebase
45- # git push
46-
47- - name : Bump version and push tag
48- id : tag_version
49- uses : mathieudutour/github-tag-action@v6.1
50- with :
51- github_token : ${{ secrets.PAT }}
52- custom_tag : ${{ steps.read_toml.outputs.value }}
5317
5418 - name : Check if the tag is prerelease tag
5519 id : is_prerelease
5620 run : |
57- if [[ "${{ steps.read_toml.outputs.value }}" == *"-"* ]]; then
21+ if [[ "${{ github.ref_name }}" == *"-"* ]]; then
5822 echo "is_prerelease=true" >> $GITHUB_ENV
5923 else
6024 echo "is_prerelease=false" >> $GITHUB_ENV
6327 - name : Create a GitHub release
6428 uses : ncipollo/release-action@v1
6529 with :
66- tag : ${{ steps.tag_version.outputs.new_tag }}
67- name : Release ${{ steps.tag_version.outputs.new_tag }}
30+ name : Release ${{ github.ref_name }}
6831 token : ${{ secrets.PAT }}
6932 generateReleaseNotes : true
7033 prerelease : ${{ env.is_prerelease }}
0 commit comments