mirror of
https://github.com/h3pdesign/Neon-Vision-Editor
synced 2026-04-21 13:27:16 +00:00
chore: update cask during release
This commit is contained in:
parent
79c69b20b5
commit
104b5fbb79
1 changed files with 11 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ fi
|
|||
|
||||
ARCHIVE_PATH="${ARCHIVE_PATH:-/tmp/NeonVisionEditor.xcarchive}"
|
||||
ZIP_NAME="Neon.Vision.Editor.app.zip"
|
||||
CASK_FILE="homebrew-tap/Casks/neon-vision-editor.rb"
|
||||
|
||||
# Checkout tag in a detached state (preserves current branch)
|
||||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD || true)
|
||||
|
|
@ -45,8 +46,17 @@ gh release create "${TAG_NAME}" \
|
|||
--notes-file release-notes.md \
|
||||
"${ZIP_NAME}"
|
||||
|
||||
# Update Homebrew cask to latest release asset and sha256
|
||||
if [[ -f "${CASK_FILE}" ]]; then
|
||||
NEW_VERSION="${TAG_NAME#v}"
|
||||
NEW_SHA=$(shasum -a 256 "${ZIP_NAME}" | awk '{print $1}')
|
||||
perl -0pi -e "s/version \"[^\"]+\"/version \"${NEW_VERSION}\"/g; s/sha256 \"[^\"]+\"/sha256 \"${NEW_SHA}\"/g" "${CASK_FILE}"
|
||||
echo "Updated ${CASK_FILE} to version ${NEW_VERSION} with sha256 ${NEW_SHA}"
|
||||
else
|
||||
echo "Cask file not found at ${CASK_FILE}" >&2
|
||||
fi
|
||||
|
||||
# Return to previous branch
|
||||
if [[ -n "${CURRENT_BRANCH}" && "${CURRENT_BRANCH}" != "HEAD" ]]; then
|
||||
git checkout -q "${CURRENT_BRANCH}"
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue