|
4 | 4 | workflow_dispatch: |
5 | 5 | inputs: |
6 | 6 | version: |
7 | | - description: "Version bump type" |
| 7 | + description: "Version bump type or explicit version" |
8 | 8 | required: true |
9 | 9 | type: choice |
10 | 10 | options: |
11 | 11 | - patch |
12 | 12 | - minor |
13 | 13 | - major |
| 14 | + - current |
14 | 15 | default: patch |
15 | 16 | dry_run: |
16 | 17 | description: "Dry run (do not publish)" |
@@ -142,40 +143,57 @@ jobs: |
142 | 143 | git status |
143 | 144 | echo "" |
144 | 145 |
|
145 | | - # Debug: Show what cargo-release will do |
146 | | - echo "Checking what cargo-release will do..." |
147 | | - cargo release ${{ inputs.version }} --list 2>&1 | tee /tmp/release-list.log || true |
148 | | -
|
149 | | - if ! grep -q "redis-cloud\|redis-enterprise\|redisctl" /tmp/release-list.log; then |
150 | | - echo "::warning::No packages detected by cargo-release. Debug info:" |
151 | | - echo "Workspace members:" |
152 | | - cargo metadata --no-deps --format-version 1 | jq -r '.workspace_members[]' |
153 | | - echo "" |
154 | | - echo "Package metadata:" |
155 | | - for pkg in redis-cloud redis-enterprise redisctl; do |
156 | | - echo "Package: $pkg" |
157 | | - cargo metadata --no-deps --format-version 1 | jq ".packages[] | select(.name == \"$pkg\") | {name, version, publish}" |
158 | | - done |
159 | | - fi |
| 146 | + # Handle "current" version option - release without bumping |
| 147 | + if [ "${{ inputs.version }}" = "current" ]; then |
| 148 | + echo "Releasing current version without bumping..." |
160 | 149 |
|
161 | | - # Run cargo-release - it will handle everything |
162 | | - # Use workspace-level release with shared-version |
163 | | - echo "Executing release..." |
164 | | - cargo release ${{ inputs.version }} \ |
165 | | - --execute --no-confirm --verbose 2>&1 | tee /tmp/release.log || { |
166 | | - echo "::error::cargo-release failed. Check the logs above for details." |
167 | | - echo "" |
168 | | - echo "Failure analysis:" |
169 | | - if grep -q "no packages selected" /tmp/release.log; then |
170 | | - echo "- cargo-release couldn't find packages to release" |
171 | | - echo "- This usually means a configuration or authentication issue" |
172 | | - fi |
173 | | - if grep -q "failed to connect" /tmp/release.log; then |
174 | | - echo "- Network/authentication issue detected" |
175 | | - echo "- Verify CARGO_REGISTRY_TOKEN is valid" |
| 150 | + # Get current version |
| 151 | + CURRENT_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.workspace.metadata.package.version // .packages[0].version') |
| 152 | + echo "Current version: $CURRENT_VERSION" |
| 153 | +
|
| 154 | + # Run cargo-release with the explicit version to skip bumping |
| 155 | + echo "Executing release of v$CURRENT_VERSION..." |
| 156 | + cargo release $CURRENT_VERSION \ |
| 157 | + --execute --no-confirm --verbose 2>&1 | tee /tmp/release.log || { |
| 158 | + echo "::error::cargo-release failed. Check the logs above for details." |
| 159 | + exit 1 |
| 160 | + } |
| 161 | + else |
| 162 | + # Debug: Show what cargo-release will do |
| 163 | + echo "Checking what cargo-release will do..." |
| 164 | + cargo release ${{ inputs.version }} --list 2>&1 | tee /tmp/release-list.log || true |
| 165 | +
|
| 166 | + if ! grep -q "redis-cloud\|redis-enterprise\|redisctl" /tmp/release-list.log; then |
| 167 | + echo "::warning::No packages detected by cargo-release. Debug info:" |
| 168 | + echo "Workspace members:" |
| 169 | + cargo metadata --no-deps --format-version 1 | jq -r '.workspace_members[]' |
| 170 | + echo "" |
| 171 | + echo "Package metadata:" |
| 172 | + for pkg in redis-cloud redis-enterprise redisctl; do |
| 173 | + echo "Package: $pkg" |
| 174 | + cargo metadata --no-deps --format-version 1 | jq ".packages[] | select(.name == \"$pkg\") | {name, version, publish}" |
| 175 | + done |
176 | 176 | fi |
177 | | - exit 1 |
178 | | - } |
| 177 | +
|
| 178 | + # Run cargo-release - it will handle everything |
| 179 | + # Use workspace-level release with shared-version |
| 180 | + echo "Executing release..." |
| 181 | + cargo release ${{ inputs.version }} \ |
| 182 | + --execute --no-confirm --verbose 2>&1 | tee /tmp/release.log || { |
| 183 | + echo "::error::cargo-release failed. Check the logs above for details." |
| 184 | + echo "" |
| 185 | + echo "Failure analysis:" |
| 186 | + if grep -q "no packages selected" /tmp/release.log; then |
| 187 | + echo "- cargo-release couldn't find packages to release" |
| 188 | + echo "- This usually means a configuration or authentication issue" |
| 189 | + fi |
| 190 | + if grep -q "failed to connect" /tmp/release.log; then |
| 191 | + echo "- Network/authentication issue detected" |
| 192 | + echo "- Verify CARGO_REGISTRY_TOKEN is valid" |
| 193 | + fi |
| 194 | + exit 1 |
| 195 | + } |
| 196 | + fi |
179 | 197 |
|
180 | 198 | - name: Report Status |
181 | 199 | if: always() |
|
0 commit comments