Skip to content

Commit d09c23c

Browse files
alexey1312claude
andcommitted
fix: harden release workflow and fix Usage spec inaccuracies
Pin usage tool to v2.18.2 in both mise.toml and release workflow, add --fail/pipefail to curl, validate generated completion files are non-empty. Fix version prefix (v2.8.0) and schemas default path in exfig.usage.kdl. Add version sync reminder to CLAUDE.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 653b66b commit d09c23c

4 files changed

Lines changed: 14 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,21 @@ jobs:
194194
195195
- name: Generate shell completions
196196
run: |
197-
curl -sL "https://github.com/jdx/usage/releases/latest/download/usage-x86_64-unknown-linux-gnu.tar.gz" | tar xz
197+
set -euo pipefail
198+
USAGE_VERSION="2.18.2"
199+
curl --fail -sL "https://github.com/jdx/usage/releases/download/v${USAGE_VERSION}/usage-x86_64-unknown-linux-gnu.tar.gz" -o usage.tar.gz
200+
tar xzf usage.tar.gz
198201
chmod +x usage/bin/usage
199202
mkdir -p completions
200203
usage/bin/usage generate completion bash exfig -f exfig.usage.kdl > completions/exfig.bash
201204
usage/bin/usage generate completion zsh exfig -f exfig.usage.kdl > completions/_exfig
202205
usage/bin/usage generate completion fish exfig -f exfig.usage.kdl > completions/exfig.fish
206+
for f in completions/exfig.bash completions/_exfig completions/exfig.fish; do
207+
if [[ ! -s "$f" ]]; then
208+
echo "::error::Generated completion file is empty: $f"
209+
exit 1
210+
fi
211+
done
203212
204213
- name: Create GitHub Release
205214
uses: softprops/action-gh-release@v2

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ Changing `load()` return type affects:
285285

286286
See `ExFigCLI/CLAUDE.md` (Adding a New Subcommand).
287287

288-
**Important:** When adding/changing CLI flags or subcommands, update `exfig.usage.kdl` (Usage spec) to keep shell completions and docs in sync.
288+
**Important:** When adding/changing CLI flags or subcommands, update `exfig.usage.kdl` (Usage spec) to keep shell completions and docs in sync. When bumping the app version in `ExFigCommand.swift`, also update the `version` field in `exfig.usage.kdl`.
289289

290290
### Adding a Figma API Endpoint
291291

exfig.usage.kdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
name "ExFig"
88
bin "exfig"
9-
version "2.8.0"
9+
version "v2.8.0"
1010
about "Exports resources from Figma to iOS, Android, Flutter, and Web projects"
1111

1212
// =============================================================================
@@ -121,7 +121,7 @@ cmd "init" help="Generates config file" {
121121
cmd "schemas" help="Extracts PKL schemas to local directory" {
122122
long_help "Extracts PKL schema files used for config validation and IDE support. Schemas are extracted to .exfig/schemas/ by default."
123123

124-
flag "-o --output <dir>" help="Output directory for schemas." default=".exfig/schemas/"
124+
flag "-o --output <dir>" help="Output directory for schemas." default=".exfig/schemas"
125125
flag "-f --force" help="Overwrite existing schema files."
126126
}
127127

mise.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ git-cliff = "2.10.1" # Changelog generation
5353
pkl = "0.31.0" # Configuration language (for hk.pkl)
5454

5555
# --- CLI Spec ---
56-
usage = "latest" # CLI spec → shell completions, docs, man pages
56+
usage = "2.18.2" # CLI spec → shell completions, docs, man pages
5757

5858
# --- Search ---
5959
"github:alexey1312/swift-index" = { version = "latest", os = [

0 commit comments

Comments
 (0)