Skip to content

Commit e45be45

Browse files
committed
Update release.yml
1 parent b42cd63 commit e45be45

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ name: Release
33
on:
44
push:
55
branches: ["main"]
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'Release version (e.g. 1.2.3)'
10+
required: true
11+
type: string
612

713
concurrency:
814
group: release-${{ github.ref }}
@@ -27,9 +33,13 @@ jobs:
2733
- name: Get version from Cargo.toml
2834
id: get_version
2935
run: |
30-
# Use cargo metadata for robust version extraction
31-
VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
32-
echo "Detected version: $VERSION"
36+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
37+
VERSION="${{ github.event.inputs.version }}"
38+
echo "Using manually provided version: $VERSION"
39+
else
40+
VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
41+
echo "Detected version from Cargo.toml: $VERSION"
42+
fi
3343
echo "version=$VERSION" >> $GITHUB_OUTPUT
3444
3545
- name: Check if tag exists

0 commit comments

Comments
 (0)