Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 52 additions & 17 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,62 @@
# This workflow will build the gem from gemspec and publish
# Builds the gem and publishes it to RubyGems.org using trusted publishing (OIDC).
#
# Runs automatically when release-please publishes a GitHub release. It can also be
# triggered manually from a release tag, e.g. to retry a failed publish.

name: Push Ruby Gem

# TODO: this workflow doesn't work, needs fixing but for now, I've just changed it so
# it will only run if triggered manually. Instructions for releasing manually are here:
# https://www.notion.so/flagsmith/SDKs-Deployment-Instructions-c1190a22238a45af9a51c7f0fea27f99
on: workflow_dispatch
on:
release:
types: [published]
workflow_dispatch:

permissions: {}

jobs:
release:
build:
runs-on: ubuntu-latest
env:
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
# Only ever publish tagged code: release events run on the release tag, and manual runs must pick one too.
if: github.ref_type == 'tag'
Comment thread
khvn26 marked this conversation as resolved.
Resolved

permissions:
contents: read

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # need all the commits
- uses: ruby/setup-ruby@v1
persist-credentials: false

- uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0
with:
ruby-version: .ruby-version
bundler-cache: true
- name: Buld and Push to rubygems.org
run: |
bundle install
gem build flagsmith.gemspec
bundle exec rake release[remote]
Comment thread
matthewelwell marked this conversation as resolved.
Resolved

- name: Build gem
run: gem build flagsmith.gemspec

- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: gem
path: flagsmith-*.gem
if-no-files-found: error

publish:
runs-on: ubuntu-latest
needs: build
environment: rubygems

permissions:
id-token: write # to authenticate with RubyGems.org via trusted publishing

steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: gem

- uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0
with:
ruby-version: ruby

- uses: rubygems/configure-rubygems-credentials@dc5a8d8553e6ee01fc26761a49e99e733d17954a # v2.1.0

- name: Push gem to RubyGems.org
run: gem push flagsmith-*.gem
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
flagsmith (4.3.0)
flagsmith (5.4.0)
Comment thread
matthewelwell marked this conversation as resolved.
Resolved
faraday (>= 2.0.1)
faraday-retry
jsonpath (~> 1.1)
Expand Down
2 changes: 1 addition & 1 deletion lib/flagsmith/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Flagsmith
VERSION = '4.3.0'
VERSION = '5.4.0'
end
2 changes: 2 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"packages": {
".": {
"release-type": "ruby",
"package-name": "flagsmith",
"version-file": "lib/flagsmith/version.rb",
"changelog-path": "CHANGELOG.md",
"bump-minor-pre-major": false,
"bump-patch-for-minor-pre-major": false,
Expand Down
Loading