diff --git a/.github/workflows/push_gem.yml b/.github/workflows/push_gem.yml new file mode 100644 index 0000000..cd39ddd --- /dev/null +++ b/.github/workflows/push_gem.yml @@ -0,0 +1,35 @@ +--- +name: Push gem + +"on": + workflow_run: + workflows: ["Ruby"] + branches: [main] + types: + - completed + +jobs: + push: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + + permissions: + contents: write + id-token: write + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + submodules: recursive + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: ruby + + - name: Release gem + uses: rubygems/release-gem@v1 + with: + gem-name: reforge diff --git a/CHANGELOG.md b/CHANGELOG.md index 14647d7..9d0b1f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog + +## 1.9.0 - 2025-08-23 + +- Moved to reforge gem name `sdk-reforge` +- Add automated gem publishing via GitHub Actions trusted publishing +- Add support for `reforge.current-time` virtual context +- Dropped the previous implementation of dynamic logging support +- Removed local file loading based on prefab-envs + ## 1.8.9 - 2025-04-15 - Fix support for virtual context `prefab.current-time` [#229] diff --git a/README.md b/README.md index 781cf30..213cac6 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,20 @@ See full documentation https://docs.prefab.cloud/docs/sdks/ruby - Live Config - WebUI for tweaking config and feature flags +## Installation + +Add the gem to your Gemfile: + +```ruby +gem 'sdk-reforge' +``` + +Or install directly: + +```bash +gem install sdk-reforge +``` + ## Important note about Forking and realtime updates Many ruby web servers fork. When the process is forked, the current realtime update stream is disconnected. If you're using Puma or Unicorn, do the following. @@ -64,12 +78,25 @@ end ## Release +Release is automated via GitHub Actions using RubyGems trusted publishing. When tests pass on the main branch, a new version is automatically published to RubyGems. + +To release a new version: + ```shell -update the changelog -update VERSION +# Update the version +echo "1.9.1" > VERSION + +# Update the changelog with your changes +# Edit CHANGELOG.md + +# Regenerate the gemspec bundle exec rake gemspec:generate -git commit & push -REMOTE_BRANCH=main LOCAL_BRANCH=main bundle exec rake release + +# Create PR with changes +git checkout -b release-1.9.1 +git commit -am "Release 1.9.1" +git push origin release-1.9.1 +# Then create and merge PR to main ``` ## Copyright diff --git a/Rakefile b/Rakefile index 6ed0e89..447b465 100644 --- a/Rakefile +++ b/Rakefile @@ -25,12 +25,12 @@ unless ENV['CI'] require 'juwelier' Juwelier::Tasks.new do |gem| # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options - gem.name = 'prefab-cloud-ruby' - gem.homepage = 'http://github.com/prefab-cloud/prefab-cloud-ruby' + gem.name = 'sdk-reforge' + gem.homepage = 'http://github.com/ReforgeHQ/sdk-ruby' gem.license = 'MIT' - gem.summary = %(Prefab Ruby Infrastructure) - gem.description = %(Feature Flags, Live Config, and Dynamic Log Levels as a service) - gem.email = 'jdwyer@prefab.cloud' + gem.summary = %(Reforge Launch Ruby Infrastructure) + gem.description = %(Feature Flags, Live Config as a service) + gem.email = 'jeff.dwyer@reforge.com.cloud' gem.authors = ['Jeff Dwyer'] # dependencies defined in Gemfile diff --git a/VERSION b/VERSION index 5af131d..abb1658 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.9 \ No newline at end of file +1.9.0 \ No newline at end of file diff --git a/prefab-cloud-ruby.gemspec b/sdk-reforge.gemspec similarity index 88% rename from prefab-cloud-ruby.gemspec rename to sdk-reforge.gemspec index 06aa96c..a08f625 100644 --- a/prefab-cloud-ruby.gemspec +++ b/sdk-reforge.gemspec @@ -2,18 +2,18 @@ # DO NOT EDIT THIS FILE DIRECTLY # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec' # -*- encoding: utf-8 -*- -# stub: prefab-cloud-ruby 1.8.9 ruby lib +# stub: sdk-reforge 1.9.0 ruby lib Gem::Specification.new do |s| - s.name = "reforge-sdk".freeze - s.version = "1.8.9" + s.name = "sdk-reforge".freeze + s.version = "1.9.0" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["Jeff Dwyer".freeze] - s.date = "2025-04-15" - s.description = "Feature Flags and Live Config as a service".freeze - s.email = "jeff.dwyer@reforge.com".freeze + s.date = "2025-09-23" + s.description = "Feature Flags, Live Config as a service".freeze + s.email = "jeff.dwyer@reforge.com.cloud".freeze s.extra_rdoc_files = [ "CHANGELOG.md", "LICENSE.txt", @@ -21,6 +21,7 @@ Gem::Specification.new do |s| ] s.files = [ ".envrc.sample", + ".github/CODEOWNERS", ".github/pull_request_template.md", ".github/workflows/ruby.yml", ".gitmodules", @@ -39,6 +40,7 @@ Gem::Specification.new do |s| "dev/benchmark", "dev/console", "dev/script_setup.rb", + "lib/prefab_pb.rb", "lib/reforge-sdk.rb", "lib/reforge/caching_http_connection.rb", "lib/reforge/client.rb", @@ -57,7 +59,7 @@ Gem::Specification.new do |s| "lib/reforge/error.rb", "lib/reforge/errors/env_var_parse_error.rb", "lib/reforge/errors/initialization_timeout_error.rb", - "lib/reforge/errors/invalid_api_key_error.rb", + "lib/reforge/errors/invalid_sdk_key_error.rb", "lib/reforge/errors/missing_default_error.rb", "lib/reforge/errors/missing_env_var_error.rb", "lib/reforge/errors/uninitialized_error.rb", @@ -71,8 +73,6 @@ Gem::Specification.new do |s| "lib/reforge/internal_logger.rb", "lib/reforge/javascript_stub.rb", "lib/reforge/local_config_parser.rb", - "lib/reforge/log_path_aggregator.rb", - "lib/reforge/logger_client.rb", "lib/reforge/murmer3.rb", "lib/reforge/options.rb", "lib/reforge/periodic_sync.rb", @@ -84,10 +84,6 @@ Gem::Specification.new do |s| "lib/reforge/time_helpers.rb", "lib/reforge/weighted_value_resolver.rb", "lib/reforge/yaml_config_parser.rb", - "lib/prefab_pb.rb", - "prefab-cloud-ruby.gemspec", - "test/.prefab.default.config.yaml", - "test/.prefab.unit_tests.config.yaml", "test/fixtures/datafile.json", "test/integration_test.rb", "test/integration_test_helpers.rb", @@ -118,8 +114,6 @@ Gem::Specification.new do |s| "test/test_internal_logger.rb", "test/test_javascript_stub.rb", "test/test_local_config_parser.rb", - "test/test_log_path_aggregator.rb", - "test/test_logger.rb", "test/test_logger_initialization.rb", "test/test_options.rb", "test/test_prefab.rb", @@ -128,10 +122,10 @@ Gem::Specification.new do |s| "test/test_sse_config_client.rb", "test/test_weighted_value_resolver.rb" ] - s.homepage = "https://github.com/ReforgeHQ/sdk-ruby".freeze + s.homepage = "http://github.com/ReforgeHQ/sdk-ruby".freeze s.licenses = ["MIT".freeze] s.rubygems_version = "3.4.19".freeze - s.summary = "Reforge SDK Ruby Infrastructure".freeze + s.summary = "Reforge Launch Ruby Infrastructure".freeze s.specification_version = 4