Skip to content

Commit 235f86a

Browse files
authored
Merge pull request #1626 from dapr/fix/create-release-trigger-build
fix(ci): trigger CLI build after creating release tag
2 parents 43b2e32 + b49b814 commit 235f86a

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

.github/workflows/create-release.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
inputs:
1919
rel_version:
2020
description: 'Release version (examples: 1.16.0-rc.1, 1.16.0)'
21-
required: true
21+
required: true
2222
type: string
2323

2424
permissions: {}
@@ -46,4 +46,12 @@ jobs:
4646
git config user.name "Dapr Bot"
4747
# Update origin with token
4848
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
49-
./.github/scripts/create-release.sh ${{ inputs.rel_version }}
49+
./.github/scripts/create-release.sh ${{ inputs.rel_version }}
50+
51+
build:
52+
name: Build and publish CLI
53+
needs: create-release
54+
uses: ./.github/workflows/dapr_cli.yaml
55+
with:
56+
tag: v${{ inputs.rel_version }}
57+
secrets: inherit

.github/workflows/dapr_cli.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
name: dapr_cli
1515

1616
on:
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
@@ -74,6 +80,8 @@ jobs:
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
@@ -90,6 +98,8 @@ jobs:
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

Comments
 (0)