@@ -67,10 +67,24 @@ jobs:
6767 needs : build
6868 runs-on : ubuntu-latest
6969 steps :
70+ - name : Checkout code
71+ uses : actions/checkout@v2
72+
73+ - name : Build await to get version
74+ run : |
75+ gcc await.c -o await -lpthread
76+
77+ - name : Get version from await CLI
78+ id : get_version
79+ run : |
80+ VERSION=$(./await --version)
81+ echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
82+ echo "Version: $VERSION"
83+
7084 - name : Check if Release Exists
7185 id : check_release
7286 run : |
73- gh release view 1.0.8 || echo "Release does not exist"
87+ gh release view ${{ steps.get_version.outputs.VERSION }} || echo "Release does not exist"
7488
7589 - name : Create or Update Release
7690 id : create_update_release
@@ -79,16 +93,16 @@ jobs:
7993 env :
8094 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8195 with :
82- tag_name : 1.0.8
83- release_name : 1.0.8
84- body : Fixed ctrl-c handling when it's run from bash script
96+ tag_name : ${{ steps.get_version.outputs.VERSION }}
97+ release_name : ${{ steps.get_version.outputs.VERSION }}
98+ body : Release version ${{ steps.get_version.outputs.VERSION }}
8599 draft : false
86100 prerelease : false
87101
88102 - name : Update Release Archives
89103 if : steps.check_release.outputs.exists == 'true'
90104 run : |
91- gh release upload 1.0.8 archives/* --clobber
105+ gh release upload ${{ steps.get_version.outputs.VERSION }} archives/* --clobber
92106
93107 - name : Download Artifact
94108 uses : actions/download-artifact@v4
@@ -97,14 +111,14 @@ jobs:
97111 run : |
98112 mkdir -p archives
99113 tree
100- tar -czvf archives/await-1.0.8 -aarch64-x86_64-apple-darwin.tar.gz -C await-macos-latest .
101- tar -czvf archives/await-1.0.8 -x86_64-unknown-linux-gnu.tar.gz -C await-ubuntu-latest .
114+ tar -czvf archives/await-${{ steps.get_version.outputs.VERSION }} -aarch64-x86_64-apple-darwin.tar.gz -C await-macos-latest .
115+ tar -czvf archives/await-${{ steps.get_version.outputs.VERSION }} -x86_64-unknown-linux-gnu.tar.gz -C await-ubuntu-latest .
102116 tree
103117
104118 - name : Upload Release Artifacts
105119 uses : softprops/action-gh-release@v1
106120 with :
107121 files : archives/*
108- tag_name : 1.0.8
122+ tag_name : ${{ steps.get_version.outputs.VERSION }}
109123 env :
110124 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments