File tree Expand file tree Collapse file tree 1 file changed +6
-16
lines changed Expand file tree Collapse file tree 1 file changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -32,29 +32,19 @@ jobs:
32
32
fetch-depth : 0
33
33
34
34
- name : Get version
35
- run : echo "VERSION=$(cat Cargo.toml | grep version | head -n1 | cut -d '"' -f2)" >> "$GITHUB_ENV"
35
+ id : get_version
36
+ run : echo "version=$(cat Cargo.toml | grep version | head -n1 | cut -d '"' -f2)" >> "$GITHUB_OUTPUT"
36
37
37
38
- uses : rickstaa/action-create-tag@v1
38
39
id : tag_create
39
40
with :
40
- tag : v${{ env.VERSION }}
41
-
42
- - name : Check if release is needed
43
- id : check
44
- run : |
45
- last_version=$(git describe --tags --abbrev=0)
46
- if [[ "$VERSION" == "$last_version" ]]; then
47
- # no release needed
48
- echo "create_release=false" >> "$GITHUB_OUTPUT"
49
- else
50
- echo "create_release=true" >> "$GITHUB_OUTPUT"
51
- fi
41
+ tag : v${{ steps.get_version.outputs.version }}
52
42
53
43
- name : Create Release
54
- if : steps.check .outputs.create_release == 'true'
44
+ if : ! steps.tag_create .outputs.tag_exists
55
45
uses : actions/create-release@v1
56
46
env :
57
47
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
58
48
with :
59
- tag_name : v${{ env.VERSION }}
60
- release_name : v${{ env.VERSION }}
49
+ tag_name : v${{ steps.get_version.outputs.version }}
50
+ release_name : v${{ steps.get_version.outputs.version }}
You can’t perform that action at this time.
0 commit comments