11name : release
22
3- # Only do the release on adl-lsp-x.y.z tags or manual workflow dispatch.
3+ # Only do the release on adl-lsp-x.y.z tags
44on :
55 push :
66 tags :
77 - " adl-lsp-[0-9]+.[0-9]+.[0-9]+"
8- workflow_dispatch :
9- inputs :
10- release_tag :
11- description : ' Release tag (e.g., adl-lsp-0.8.3) or version (e.g., 0.8.3)'
12- required : true
13- type : string
148
159# We need this to be able to create releases.
1610permissions :
@@ -25,18 +19,11 @@ jobs:
2519 runs-on : ubuntu-latest
2620 steps :
2721 - uses : actions/checkout@v4
28- - name : Get the release version from the tag or workflow dispatch
22+ - name : Get the release version from the tag
2923 shell : bash
3024 run : |
31- if [ "${{ github.event_name }}" = "push" ]; then
32- # Extract version from git tag (e.g., adl-lsp-0.8.2 -> 0.8.2)
33- VERSION=${GITHUB_REF#refs/tags/adl-lsp-}
34- else
35- # Use version from workflow_dispatch input
36- INPUT_VERSION="${{ github.event.inputs.release_tag }}"
37- # Remove the adl-lsp- prefix if it exists
38- VERSION=${INPUT_VERSION#adl-lsp-}
39- fi
25+ # Extract version from git tag (e.g., adl-lsp-0.8.2 -> 0.8.2)
26+ VERSION=${GITHUB_REF#refs/tags/adl-lsp-}
4027 echo "VERSION=$VERSION" >> $GITHUB_ENV
4128 echo "Extracted version: $VERSION"
4229 - name : Show the version
@@ -53,14 +40,10 @@ jobs:
5340 env :
5441 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5542 run : |
56- if [ "${{ github.event_name }}" = "push" ]; then
57- gh release create $VERSION --draft --verify-tag --title $VERSION
58- else
59- gh release create "adl-lsp-$VERSION" --draft --title "adl-lsp $VERSION"
60- fi
43+ gh release create $VERSION --draft --title $VERSION
6144 outputs :
6245 version : ${{ env.VERSION }}
63- release_tag : ${{ github.event_name == 'push' && env.VERSION || format('adl-lsp-{0}', env.VERSION) }}
46+ release_tag : ${{ env.VERSION }}
6447
6548 build-release :
6649 name : build-release
0 commit comments