1414name : dapr_cli
1515
1616on :
17+ workflow_call :
18+ inputs :
19+ tag :
20+ type : string
21+ required : true
22+ description : ' Git tag to build and publish (e.g., v1.16.0)'
1723 push :
1824 branches :
1925 - master
7480 mkdir -p $HOME/bin
7581 - name : Check out code into the Go module directory
7682 uses : actions/checkout@v4
83+ with :
84+ ref : ${{ inputs.tag || '' }}
7785 - name : Set up Go
7886 uses : actions/setup-go@v5
7987 id : setup-go
9098 run : make modtidy check-diff
9199 - name : Parse release version and set REL_VERSION
92100 run : python ./.github/scripts/get_release_version.py
101+ env :
102+ GITHUB_REF : ${{ inputs.tag && format('refs/tags/{0}', inputs.tag) || github.ref }}
93103 - name : Setup test output
94104 shell : bash
95105 run : |
@@ -132,7 +142,7 @@ jobs:
132142 publish :
133143 name : Publish binaries
134144 needs : build
135- if : startswith(github.ref, 'refs/tags/v')
145+ if : startswith(github.ref, 'refs/tags/v') || inputs.tag != ''
136146 env :
137147 ARTIFACT_DIR : ./release
138148 runs-on : ubuntu-latest
@@ -154,7 +164,6 @@ jobs:
154164 - name : lists artifacts
155165 run : ls -l ${{ env.ARTIFACT_DIR }}
156166 - name : publish binaries to github
157- if : startswith(github.ref, 'refs/tags/v')
158167 run : |
159168 # Get the list of files
160169 RELEASE_ARTIFACT=(${ARTIFACT_DIR}/*)
@@ -169,13 +178,17 @@ jobs:
169178 publish-winget :
170179 name : Publish to winget-pkgs
171180 needs : publish
172- if : startswith(github.ref, 'refs/tags/v')
181+ if : startswith(github.ref, 'refs/tags/v') || inputs.tag != ''
173182 runs-on : windows-latest
174183 steps :
175184 - name : Check out code
176185 uses : actions/checkout@v4
186+ with :
187+ ref : ${{ inputs.tag || '' }}
177188 - name : Parse release version and set REL_VERSION
178189 run : python ./.github/scripts/get_release_version.py
190+ env :
191+ GITHUB_REF : ${{ inputs.tag && format('refs/tags/{0}', inputs.tag) || github.ref }}
179192 - name : Update winget manifests
180193 shell : pwsh
181194 run : |
0 commit comments