File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,39 @@ jobs:
109109 name : vendored-assets
110110 path : crates-tauri/yaak-app/vendored
111111
112+ - name : Set CLI build version
113+ shell : bash
114+ env :
115+ WORKFLOW_VERSION : ${{ inputs.version }}
116+ run : |
117+ set -euo pipefail
118+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
119+ VERSION="$WORKFLOW_VERSION"
120+ else
121+ VERSION="${GITHUB_REF_NAME#yaak-cli-}"
122+ fi
123+ VERSION="${VERSION#v}"
124+ echo "Building yaak version: $VERSION"
125+ python - "$VERSION" <<'PY'
126+ import pathlib
127+ import re
128+ import sys
129+
130+ version = sys.argv[1]
131+ manifest = pathlib.Path("crates-cli/yaak-cli/Cargo.toml")
132+ contents = manifest.read_text()
133+ updated, replacements = re.subn(
134+ r'(?m)^version = ".*"$',
135+ f'version = "{version}"',
136+ contents,
137+ count=1,
138+ )
139+ if replacements != 1:
140+ raise SystemExit("Failed to update yaak-cli version in Cargo.toml")
141+ manifest.write_text(updated)
142+ print(f"Updated {manifest} to version {version}")
143+ PY
144+
112145 - name : Build yaak
113146 run : cargo build --locked --release -p yaak-cli --bin yaak --target ${{ matrix.target }}
114147
You can’t perform that action at this time.
0 commit comments