Compare commits

..
Author SHA1 Message Date
TomZz 7ae44ab9a7 ci: automate homebrew cask release for macos 2026-06-17 05:59:05 +08:00
+21 -14
View File
@@ -197,18 +197,17 @@ jobs:
mkdir -p tap/Casks
CASK_FILE="tap/Casks/ashell.rb"
if [ ! -f "$CASK_FILE" ]; then
cat > "$CASK_FILE" <<'EOF'
cat > "$CASK_FILE" <<EOF
cask "ashell" do
version "0.0.0"
version "${VERSION}"
on_arm do
sha256 "0"
url "https://github.com/rust-kotlin/ashell/releases/download/v#{version}/ashell-#{version}-macos-aarch64.zip"
sha256 "${SHA_ARM}"
url "https://github.com/rust-kotlin/ashell/releases/download/v#{version}/ashell-v#{version}-macos-aarch64.zip"
end
on_intel do
sha256 "0"
url "https://github.com/rust-kotlin/ashell/releases/download/v#{version}/ashell-#{version}-macos-x86_64.zip"
sha256 "${SHA_INTEL}"
url "https://github.com/rust-kotlin/ashell/releases/download/v#{version}/ashell-v#{version}-macos-x86_64.zip"
end
name "ashell"
@@ -216,15 +215,23 @@ jobs:
homepage "https://github.com/rust-kotlin/ashell"
app "ashell.app"
postflight do
puts "Removing quarantine flag from ashell.app..."
system_command "/usr/bin/xattr",
args: ["-rd", "com.apple.quarantine", "#{appdir}/ashell.app"],
sudo: true
end
caveats <<~EOS
ashell is not notarized. The installation includes a postflight script
that removes the 'com.apple.quarantine' attribute from the application
to allow it to run. This will require your administrator password.
EOS
end
EOF
# Remove the 10 leading spaces added for YAML formatting
sed -i 's/^ //' "$CASK_FILE"
fi
sed -i "s|version \".*\"|version \"${VERSION}\"|" "$CASK_FILE"
sed -i "/on_arm do/,/end/ s|sha256 \".*\"|sha256 \"${SHA_ARM}\"|" "$CASK_FILE"
sed -i "/on_intel do/,/end/ s|sha256 \".*\"|sha256 \"${SHA_INTEL}\"|" "$CASK_FILE"
# Remove the 10 leading spaces added for YAML formatting
sed -i 's/^ //' "$CASK_FILE"
- name: Commit and Push
run: |