@@ -26,12 +26,11 @@ jobs:
26
26
- name : Set env.COMMIT_HASH
27
27
run : echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
28
28
29
- - name : Extract version from commit message
30
- id : extract_version
29
+ - name : Get version from commit
31
30
run : |
32
- COMMIT_MESSAGE =$(git log -1 --pretty=%B )
33
- if [[ $COMMIT_MESSAGE =~ release:\ v([0-9]+\.[0-9]+\.[0-9]+) ] ]; then
34
- echo "VERSION=${BASH_REMATCH[1]} " >> $GITHUB_ENV
31
+ VERSION =$(echo "${{ github.event.head_commit.message }}" | grep -oP '(?<=Release v)\d+\.\d+\.\d+' || echo '' )
32
+ if [ ! -z "$VERSION" ]; then
33
+ echo "VERSION=$VERSION " >> $GITHUB_ENV
35
34
else
36
35
echo "No version found in commit message"
37
36
exit 1
@@ -49,17 +48,17 @@ jobs:
49
48
50
49
- name : Rename build files
51
50
run : |
52
- mv bin/transit-linux-x64 bin/transit-${{env.VERSION}}-linux-x64
53
- mv bin/transit-linux-arm64 bin/transit-${{env.VERSION}}-linux-arm64
54
- mv bin/transit-windows-x64.exe bin/transit-${{env.VERSION}}-windows-x64.exe
51
+ mv bin/transit-linux-x64 bin/transit-${{ github. env.VERSION }}-linux-x64
52
+ mv bin/transit-linux-arm64 bin/transit-${{ github. env.VERSION }}-linux-arm64
53
+ mv bin/transit-windows-x64.exe bin/transit-${{ github. env.VERSION }}-windows-x64.exe
55
54
56
55
- name : Create release and upload assets
57
56
uses : softprops/action-gh-release@v1
58
57
with :
59
- tag_name : ' v${{env.VERSION}}'
58
+ tag_name : ' v${{ github. env.VERSION }}'
60
59
files : |
61
- bin/transit-${{env.VERSION}}-linux-x64
62
- bin/transit-${{env.VERSION}}-linux-arm64
63
- bin/transit-${{env.VERSION}}-windows-x64.exe
60
+ bin/transit-${{ github. env.VERSION }}-linux-x64
61
+ bin/transit-${{ github. env.VERSION }}-linux-arm64
62
+ bin/transit-${{ github. env.VERSION }}-windows-x64.exe
64
63
env :
65
64
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments