Skip to content

Commit 560ec85

Browse files
committed
ci: support manual zimaos link release publish
1 parent c128ca1 commit 560ec85

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/zimaos-link.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
description: "Features for easytier-core build (optional)"
1616
required: true
1717
default: ""
18+
release_tag:
19+
description: "Optional release tag to publish after build, e.g. zimaos-link-v0.1.34"
20+
required: false
21+
default: ""
1822

1923
push:
2024
branches: ["develop", "main", "mt", "icewhale/**"]
@@ -208,10 +212,15 @@ jobs:
208212

209213
publish-release:
210214
needs: build-link
211-
if: startsWith(github.ref, 'refs/tags/zimaos-link-v')
215+
if: |
216+
startsWith(github.ref, 'refs/tags/zimaos-link-v') ||
217+
(github.event_name == 'workflow_dispatch' &&
218+
startsWith(github.event.inputs.release_tag, 'zimaos-link-v'))
212219
runs-on: [self-hosted, Linux, X64, easytier]
213220
permissions:
214221
contents: write
222+
env:
223+
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag || github.ref_name }}
215224
steps:
216225
- name: Checkout repository
217226
uses: actions/checkout@v4
@@ -227,7 +236,7 @@ jobs:
227236
- name: Generate custom release notes
228237
env:
229238
REPO: ${{ github.repository }}
230-
TAG_NAME: ${{ github.ref_name }}
239+
TAG_NAME: ${{ env.RELEASE_TAG }}
231240
COMMIT_SHA: ${{ github.sha }}
232241
RUN_ID: ${{ github.run_id }}
233242
run: |
@@ -277,8 +286,9 @@ jobs:
277286
- name: Publish GitHub Release
278287
uses: softprops/action-gh-release@v2
279288
with:
280-
tag_name: ${{ github.ref_name }}
281-
name: ZimaOS Link ${{ github.ref_name }}
289+
tag_name: ${{ env.RELEASE_TAG }}
290+
name: ZimaOS Link ${{ env.RELEASE_TAG }}
282291
body_path: release_notes.md
283292
files: |
284293
release_assets/*
294+
target_commitish: ${{ github.sha }}

0 commit comments

Comments
 (0)