Skip to content

Commit

Permalink
Merge pull request #197483 from Homebrew/update-defold
Browse files Browse the repository at this point in the history
defold*: update livecheck
  • Loading branch information
chenrui333 authored Jan 7, 2025
2 parents 56724bc + b045e3d commit c2ceceb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 32 deletions.
10 changes: 4 additions & 6 deletions Casks/d/defold.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
desc "Game engine for development of desktop, mobile and web games"
homepage "https://defold.com/"

# Upstream only marks alpha releases as "pre-release", so the "latest" GitHub
# release is sometimes a beta version. As such, it's necessary to check
# multiple recent releases to identify the latest stable version.
livecheck do
url :url
regex(/^v?(\d+(?:\.\d+)+)$/i)
strategy :github_releases
url "http://d.defold.com/stable/info.json"
strategy :json do |json|
json["version"]
end
end

auto_updates true
Expand Down
16 changes: 3 additions & 13 deletions Casks/d/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,10 @@
desc "Game engine for development of desktop, mobile and web games"
homepage "https://defold.com/"

# The `GithubReleases` strategy omits releases marked as pre-release, so we
# have to use a `strategy` block to work with unstable versions.
livecheck do
url :url
regex(/^v?(\d+(?:\.\d+)+)[._-]alpha$/i)
strategy :github_releases do |json, regex|
json.map do |release|
next if release["draft"]

match = release["tag_name"]&.match(regex)
next if match.blank?

match[1]
end
url "http://d.defold.com/alpha/info.json"
strategy :json do |json|
json["version"]
end
end

Expand Down
16 changes: 3 additions & 13 deletions Casks/d/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,10 @@
desc "Game engine for development of desktop, mobile and web games"
homepage "https://defold.com/"

# The `GithubReleases` strategy omits releases marked as pre-release, so we
# have to use a `strategy` block to work with unstable versions.
livecheck do
url :url
regex(/^v?(\d+(?:\.\d+)+)[._-]beta$/i)
strategy :github_releases do |json, regex|
json.map do |release|
next if release["draft"]

match = release["tag_name"]&.match(regex)
next if match.blank?

match[1]
end
url "http://d.defold.com/beta/info.json"
strategy :json do |json|
json["version"]
end
end

Expand Down

0 comments on commit c2ceceb

Please sign in to comment.