Skip to content

Commit

Permalink
Add release:latest_github_release task
Browse files Browse the repository at this point in the history
Requires installing the `gh` CLI. Gets the latest release from GitHub and outputs the version to STDOUT.
  • Loading branch information
darronschall committed May 28, 2024
1 parent 04f3ebf commit 545fa32
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tasks/release.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

require "rake"

desc "Gets the latest GitHub release version, e.g: v1.1.1"
task "release:latest_github_release" do
# We could use `git` here to get the most recent version tag, like:
# `git tag --list --sort='-version:refname' 'v*' | head -n1`
# but we go through the `gh` because we want the latest _GitHub_ release.
$stdout << `gh release view --json tagName --jq '.tagName'`
end

0 comments on commit 545fa32

Please sign in to comment.