From a94d42dee7e9487fd56ec473f24b3c279346cf6c Mon Sep 17 00:00:00 2001 From: jimtng <2554958+jimtng@users.noreply.github.com> Date: Sat, 6 Jul 2024 10:01:36 +1000 Subject: [PATCH] Support Milestones and RC versions (#302) --- .github/workflows/ci.yml | 4 +++- lib/openhab/core.rb | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ace884cb0..4ddbc8a94e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: if: "!contains(github.event.head_commit.message, 'ci skip')" outputs: openhab_matrix: | - ["3.4.5", "4.0.4", "4.1.1", "4.2.0-SNAPSHOT"] + ["3.4.5", "4.0.4", "4.1.1", "4.2.0.RC1", "4.2.0-SNAPSHOT"] snapshot_date: | ${{ steps.snapshot-date.outputs.SNAPSHOT_DATE }} steps: @@ -135,6 +135,8 @@ jobs: jruby_version: jruby-9.3.10.0 - openhab_version: 4.2.0-SNAPSHOT jruby_version: jruby-9.3.10.0 + - openhab_version: 4.2.0.RC1 + jruby_version: jruby-9.3.10.0 steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 diff --git a/lib/openhab/core.rb b/lib/openhab/core.rb index 06e9d4af6b..b6a71624fa 100644 --- a/lib/openhab/core.rb +++ b/lib/openhab/core.rb @@ -15,9 +15,10 @@ module Core V4_2 = Gem::Version.new("4.2.0").freeze # @return [Gem::Version] Returns the current openHAB version as a Gem::Version object + # Note, this strips off snapshots, milestones and RC versions and returns the release version. # @!visibility private def self.version - @version ||= Gem::Version.new(VERSION).freeze + @version ||= Gem::Version.new(VERSION).release.freeze end raise "`openhab-scripting` requires openHAB >= 3.4.0" unless version >= Gem::Version.new("3.4.0")