File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff 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"
You can’t perform that action at this time.
0 commit comments