Skip to content

Commit aa73813

Browse files
authored
Update bottle.yml
1 parent 0167bd4 commit aa73813

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.github/workflows/bottle.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,27 @@ jobs:
141141
id: meta
142142
run: |
143143
set -euo pipefail
144-
VERSION=$(grep -E 'version "[0-9]+\.[0-9]+\.[0-9]+"' Formula/mfc.rb | sed -E 's/.*version "([^"]+)".*/\1/')
144+
145+
# Extract URL from the formula
146+
URL=$(grep -E 'url "https://github.com/.*/archive/refs/tags/v[0-9]+\.[0-9]+\.[0-9]+\.tar\.gz"' Formula/mfc.rb \
147+
| sed -E 's/.*url "([^"]+)".*/\1/')
148+
149+
if [[ -z "${URL}" ]]; then
150+
echo "Could not extract URL from Formula/mfc.rb" >&2
151+
exit 1
152+
fi
153+
154+
# Parse version from the URL (…/vX.Y.Z.tar.gz)
155+
VERSION=$(echo "${URL}" | sed -E 's/.*v([0-9]+\.[0-9]+\.[0-9]+)\.tar\.gz/\1/')
156+
157+
if [[ -z "${VERSION}" ]]; then
158+
echo "Could not parse version from URL: ${URL}" >&2
159+
exit 1
160+
fi
161+
145162
TAG="mfc-${VERSION}"
146163
ROOT_URL="https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG}"
164+
147165
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
148166
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
149167
echo "root_url=${ROOT_URL}" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)