From e342790dec51bb5ebd1e322cac096b89d45a272e Mon Sep 17 00:00:00 2001 From: James Date: Fri, 17 Oct 2025 11:24:30 +0100 Subject: [PATCH 1/3] BRD-20938 convert packages from RubyGems.org to github --- .github/workflows/publish.yml | 36 +++++++++++++++++++++++++++++++++++ README.md | 26 +++++++++++++++++++++++++ scorm_engine.gemspec | 6 +++++- 3 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e93365d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,36 @@ +name: Publish to GitHub Gems + +on: + push: + tags: + - 'v*.*.*' + +jobs: + publish: + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + # ruby-version is not needed with a .ruby-version + bundler-cache: true + + - name: Install dependencies + run: bundle install + + - name: Build gem + run: gem build scorm_engine.gemspec + + - name: Publish to GitHub Packages + env: + GEM_HOST_API_KEY: ${{ secrets.GIT_HUB_PACKAGES_TOKEN }} + run: | + gem push --host https://rubygems.pkg.github.com/get-bridge *.gem \ No newline at end of file diff --git a/README.md b/README.md index bd8144f..a369e17 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,32 @@ A ruby client for Rustici's SCORM Engine 2017.1 API and limited support for the ## Installation +### From GitHub Packages (Recommended) + +Remote packages: +New versions are automatically published to GitHub Packages when a git tag matching `v*.*.*` (e.g., `v0.10.0`) is pushed to the repository. + +Local packages: +First, configure your Bundler to authenticate with GitHub Packages: + +```bash +# Replace YOUR_GITHUB_USERNAME and YOUR_GITHUB_TOKEN with your actual values +bundle config https://rubygems.pkg.github.com/get-bridge YOUR_GITHUB_USERNAME:YOUR_GITHUB_TOKEN +``` + +You'll need a GitHub Personal Access Token with `read:packages` scope. Create one at: +https://github.com/settings/tokens + +Then add this line to your application's Gemfile: + +```ruby +source "https://rubygems.pkg.github.com/get-bridge" do + gem 'scorm_engine' +end +``` + +### From RubyGems (Legacy) + Add this line to your application's Gemfile: gem 'scorm_engine' diff --git a/scorm_engine.gemspec b/scorm_engine.gemspec index f00b946..b961b08 100644 --- a/scorm_engine.gemspec +++ b/scorm_engine.gemspec @@ -12,7 +12,11 @@ Gem::Specification.new do |spec| spec.description = "Ruby Client for Rustici's SCORM Engine 24 API v2" spec.homepage = "https://github.com/get-bridge/scorm_engine" spec.license = "MIT" - spec.metadata = { "documentation_uri" => "https://get-bridge.github.io/scorm_engine/" } + spec.metadata = { + "documentation_uri" => "https://get-bridge.github.io/scorm_engine/", + "github_repo" => "https://github.com/get-bridge/scorm_engine", + "source_code_uri" => "https://github.com/get-bridge/scorm_engine" + } spec.files = Dir.glob("{lib,spec}/**/*") + %w[Rakefile .rspec] spec.bindir = "exe" From 680f4b01a832ba02ca6b013400af4e9794524edd Mon Sep 17 00:00:00 2001 From: James Date: Fri, 17 Oct 2025 12:16:43 +0100 Subject: [PATCH 2/3] BRD-20938 - PR suggestions --- .github/workflows/publish.yml | 2 +- scorm_engine.gemspec | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e93365d..f6f614e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -33,4 +33,4 @@ jobs: env: GEM_HOST_API_KEY: ${{ secrets.GIT_HUB_PACKAGES_TOKEN }} run: | - gem push --host https://rubygems.pkg.github.com/get-bridge *.gem \ No newline at end of file + gem push --host https://rubygems.pkg.github.com/get-bridge *.gem diff --git a/scorm_engine.gemspec b/scorm_engine.gemspec index b961b08..e955f86 100644 --- a/scorm_engine.gemspec +++ b/scorm_engine.gemspec @@ -15,7 +15,8 @@ Gem::Specification.new do |spec| spec.metadata = { "documentation_uri" => "https://get-bridge.github.io/scorm_engine/", "github_repo" => "https://github.com/get-bridge/scorm_engine", - "source_code_uri" => "https://github.com/get-bridge/scorm_engine" + "source_code_uri" => "https://github.com/get-bridge/scorm_engine", + "allowed_push_host" => "https://rubygems.pkg.github.com/get-bridge" } spec.files = Dir.glob("{lib,spec}/**/*") + %w[Rakefile .rspec] From ba53047626f73a03cd75b9113c8afc8a1c33eca9 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 17 Oct 2025 14:39:25 +0100 Subject: [PATCH 3/3] BRD-20938 fix Rubocop error --- scorm_engine.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scorm_engine.gemspec b/scorm_engine.gemspec index e955f86..9f54f26 100644 --- a/scorm_engine.gemspec +++ b/scorm_engine.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |spec| spec.description = "Ruby Client for Rustici's SCORM Engine 24 API v2" spec.homepage = "https://github.com/get-bridge/scorm_engine" spec.license = "MIT" - spec.metadata = { + spec.metadata = { "documentation_uri" => "https://get-bridge.github.io/scorm_engine/", "github_repo" => "https://github.com/get-bridge/scorm_engine", "source_code_uri" => "https://github.com/get-bridge/scorm_engine",