Skip to content

Commit e36915c

Browse files
committed
fix(ci): stabilize pipeline release handoff and apply rustfmt
1 parent a2357e0 commit e36915c

File tree

2 files changed

+30
-24
lines changed

2 files changed

+30
-24
lines changed

.github/workflows/pipe.yaml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ jobs:
167167
runs-on: ubuntu-latest
168168
if: github.ref == 'refs/heads/main'
169169
outputs:
170-
version: ${{ steps.semantic-release.outputs.new_release_version }}
171-
upload_url: ${{ steps.semantic-release.outputs.upload_url }}
170+
version: ${{ steps.release-meta.outputs.version }}
172171
steps:
173172
- name: Checkout code
174173
uses: actions/checkout@v6
@@ -198,6 +197,22 @@ jobs:
198197
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
199198
run: npx semantic-release
200199

200+
- name: Resolve released version
201+
id: release-meta
202+
run: |
203+
REPO="RouHim/binvec"
204+
LATEST_RELEASE_JSON=$(curl --silent --retry 5 --retry-delay 2 "https://api.github.com/repos/$REPO/releases/latest")
205+
LATEST_RELEASE=$(echo "$LATEST_RELEASE_JSON" | jq -r '.tag_name')
206+
207+
if [[ -z "$LATEST_RELEASE" || "$LATEST_RELEASE" == "null" ]]; then
208+
echo "Failed to resolve release version from GitHub API."
209+
echo "API Response: $LATEST_RELEASE_JSON"
210+
exit 1
211+
fi
212+
213+
echo "Resolved release version: $LATEST_RELEASE"
214+
echo "version=$LATEST_RELEASE" >> "$GITHUB_OUTPUT"
215+
201216
- name: Delete old releases
202217
uses: dev-drprasad/delete-older-releases@v0.3.4
203218
with:
@@ -221,25 +236,22 @@ jobs:
221236
- name: Set version and upload URL from semantic-release
222237
run: |
223238
echo "VERSION=${{ needs.create-release.outputs.version }}" >> $GITHUB_ENV
224-
echo "UPLOAD_URL=${{ needs.create-release.outputs.upload_url }}" >> $GITHUB_ENV
225239
226-
- name: Fallback to fetch release info if needed
227-
if: env.VERSION == '' || env.UPLOAD_URL == ''
240+
- name: Fallback to fetch release version if needed
241+
if: env.VERSION == ''
228242
run: |
229243
REPO="RouHim/binvec"
230244
LATEST_RELEASE_JSON=$(curl --silent --retry 3 "https://api.github.com/repos/$REPO/releases/latest")
231245
LATEST_RELEASE=$(echo "$LATEST_RELEASE_JSON" | jq -r '.tag_name')
232-
UPLOAD_URL=$(echo "$LATEST_RELEASE_JSON" | jq -r '.upload_url')
233246
234-
if [[ -z "$LATEST_RELEASE" || "$LATEST_RELEASE" == "null" || -z "$UPLOAD_URL" || "$UPLOAD_URL" == "null" ]]; then
235-
echo "Failed to fetch release information. Tag or Upload URL might be null."
247+
if [[ -z "$LATEST_RELEASE" || "$LATEST_RELEASE" == "null" ]]; then
248+
echo "Failed to fetch release version."
236249
echo "API Response: $LATEST_RELEASE_JSON"
237250
exit 1
238251
fi
239252
240253
echo "Latest release is $LATEST_RELEASE"
241254
echo "VERSION=$LATEST_RELEASE" >> $GITHUB_ENV
242-
echo "UPLOAD_URL=${UPLOAD_URL}" >> $GITHUB_ENV
243255
244256
- name: Update version in Cargo.toml
245257
run: |
@@ -414,4 +426,3 @@ jobs:
414426
commit_message: "Update to v${{ env.VERSION }}"
415427
force_push: "true"
416428
ssh_keyscan_types: "rsa,ecdsa,ed25519"
417-

src/main.rs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,9 @@ impl UiState {
252252
col = col.push(make_title("Settings"));
253253

254254
// With colors checkbox
255-
let color_checkbox =
256-
checkbox(self.vector_image_config.with_color)
257-
.label("Generate with colors")
258-
.on_toggle(UiMessage::WithColorToggled);
255+
let color_checkbox = checkbox(self.vector_image_config.with_color)
256+
.label("Generate with colors")
257+
.on_toggle(UiMessage::WithColorToggled);
259258

260259
col = col.push(color_checkbox);
261260

@@ -265,11 +264,9 @@ impl UiState {
265264
col = col.push(text("Black & White Options").size(16));
266265

267266
// Ignore alpha channel checkbox
268-
let alpha_checkbox = checkbox(
269-
self.vector_image_config.ignore_alpha_channel,
270-
)
271-
.label("Ignore alpha channel")
272-
.on_toggle(UiMessage::IgnoreAlphaChannelToggled);
267+
let alpha_checkbox = checkbox(self.vector_image_config.ignore_alpha_channel)
268+
.label("Ignore alpha channel")
269+
.on_toggle(UiMessage::IgnoreAlphaChannelToggled);
273270

274271
col = col.push(alpha_checkbox);
275272

@@ -292,11 +289,9 @@ impl UiState {
292289
);
293290

294291
// Invert black/white checkbox
295-
let invert_checkbox = checkbox(
296-
self.vector_image_config.invert_binary,
297-
)
298-
.label("Invert black / white")
299-
.on_toggle(UiMessage::InvertBinaryToggled);
292+
let invert_checkbox = checkbox(self.vector_image_config.invert_binary)
293+
.label("Invert black / white")
294+
.on_toggle(UiMessage::InvertBinaryToggled);
300295

301296
col = col.push(invert_checkbox);
302297
} else {

0 commit comments

Comments
 (0)