Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: setup initial release process #23

Merged
merged 9 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
27 changes: 25 additions & 2 deletions .github/workflows/pr-title-lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Lint PR"
name: 'Lint PR'

on:
pull_request_target:
Expand All @@ -12,6 +12,29 @@ jobs:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
- uses: amannn/action-semantic-pull-request@e9fabac35e210fea40ca5b14c0da95a099eff26f # v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
Details:

```
${{ steps.lint_pr_title.outputs.error_message }}
```
# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2
with:
header: pr-title-lint-error
delete: true
59 changes: 59 additions & 0 deletions .github/workflows/release-please.yaml
maxveldink marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release Please

on:
push:
branches:
- main

jobs:
release-please:
name: Release Please
runs-on: ubuntu-latest
# Release-please creates a PR that tracks all changes
steps:
- uses: google-github-actions/release-please-action@v3
maxveldink marked this conversation as resolved.
Show resolved Hide resolved
id: release
with:
release-type: ruby
command: manifest
token: ${{ secrets.RELEASE_PLEASE_ACTION_TOKEN }}
default-branch: main
signoff: "OpenFeature Bot <[email protected]>"

- name: Dump Release Please Output
maxveldink marked this conversation as resolved.
Show resolved Hide resolved
env:
RELEASE_PLEASE_OUTPUT: ${{ toJson(steps.release.outputs) }}
run: |
echo "$RELEASE_PLEASE_OUTPUT"

outputs:
all: ${{ toJSON(steps.release.outputs) }}
paths_released: ${{ steps.release.outputs.paths_released }}

publish-gems:
name: Publish Ruby Gems
needs: release-please
runs-on: ubuntu-latest
if: ${{ fromJSON(needs.release-please.outputs.paths_released)[0] != null }}
strategy:
matrix:
path: ${{ fromJSON(needs.release-please.outputs.paths_released) }}
env:
TAG: ${{ fromJSON(needs.release-please.outputs.all)[format('{0}--tag_name', matrix.path)] }}
defaults:
run:
working-directory: ./${{ matrix.path }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
ref: ${{ env.TAG }}

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
# TODO see if the ruby version matter for publishing
# ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

## TODO add a step to publish the gem
4 changes: 4 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"providers/openfeature-flagd-provider": "0.0.1",
"providers/openfeature-sdk-meta_provider": "0.0.1"
maxveldink marked this conversation as resolved.
Show resolved Hide resolved
}
2 changes: 1 addition & 1 deletion providers/openfeature-flagd-provider/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# OpenFeature FlagD Provider for Ruby

This is the Ruby [provider](https://openfeature.dev/docs/specification/sections/providers) implementation of the [FlagD](https://github.com/open-feature/flagd)

## Installation

Add this line to your application's Gemfile:
Expand Down Expand Up @@ -75,7 +76,6 @@ OpenFeature::SDK.configure do |config|
end
```


If no environment variables are set the [default configuration](./lib/openfeature/flagd/provider/configuration.rb) is set

## Contributing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

require_relative "provider/configuration"
require_relative "provider/client"
require_relative "provider/version"

module OpenFeature
module FlagD
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

module OpenFeature
module FlagD
VERSION = "0.0.1"
end
end
maxveldink marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# frozen_string_literal: true

require_relative "lib/openfeature/flagd/provider/version"

Gem::Specification.new do |spec|
spec.name = "openfeature-flagd-provider"
spec.version = "0.0.1"
spec.version = OpenFeature::FlagD::VERSION
spec.authors = ["OpenFeature Authors"]
spec.email = ["[email protected]"]

Expand All @@ -14,7 +16,7 @@ Gem::Specification.new do |spec|

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/open-feature/ruby-sdk-contrib/providers/openfeature-flagd-provider"
spec.metadata["changelog_uri"] = "https://github.com/open-feature/ruby-sdk-contrib/blob/main/CHANGELOG.md"
spec.metadata["changelog_uri"] = "https://github.com/open-feature/ruby-sdk-contrib/blob/main/providers/openfeature-flagd-provider/CHANGELOG.md"
spec.metadata["bug_tracker_uri"] = "https://github.com/open-feature/ruby-sdk-contrib/issues"
spec.metadata["documentation_uri"] = "https://github.com/open-feature/ruby-sdk-contrib/README.md"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require_relative "version"

module OpenFeature
module SDK
module Provider
Expand Down
maxveldink marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module OpenFeature
module SDK
module Provider
VERSION = "0.0.1"
end
end
end
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# frozen_string_literal: true

require_relative "lib/open_feature/sdk/proivder/version"
maxveldink marked this conversation as resolved.
Show resolved Hide resolved

Gem::Specification.new do |spec|
spec.name = "openfeature-sdk-meta_provider"
spec.version = "0.1.0"
spec.version = OpenFeature::SDK::Provider::VERSION
spec.authors = ["OpenFeature Authors"]
spec.email = ["[email protected]"]

Expand All @@ -14,7 +16,7 @@ Gem::Specification.new do |spec|

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/open-feature/ruby-sdk-contrib/providers/openfeature-sdk-meta_provider"
spec.metadata["changelog_uri"] = "https://github.com/open-feature/ruby-sdk-contrib/blob/main/CHANGELOG.md"
spec.metadata["changelog_uri"] = "https://github.com/open-feature/ruby-sdk-contrib/blob/main/providers/openfeature-sdk-meta_provider/CHANGELOG.md"
maxveldink marked this conversation as resolved.
Show resolved Hide resolved
spec.metadata["bug_tracker_uri"] = "https://github.com/open-feature/ruby-sdk-contrib/issues"
spec.metadata["documentation_uri"] = "https://github.com/open-feature/ruby-sdk-contrib/README.md"

Expand Down
76 changes: 76 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"separate-pull-requests": true,
maxveldink marked this conversation as resolved.
Show resolved Hide resolved
"packages": {
"providers/openfeature-flagd-provider": {
"package-name": "openfeature-flagd-provider",
"version-file": "lib/openfeature/flagd/provider/version.rb",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"versioning": "default",
"extra-files": ["README.md"]
},
"providers/openfeature-sdk-meta_provider": {
"package-name": "openfeature-flagd-provider",
beeme1mr marked this conversation as resolved.
Show resolved Hide resolved
"version-file": "lib/openfeature/flagd/provider/version.rb",
beeme1mr marked this conversation as resolved.
Show resolved Hide resolved
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"versioning": "default",
"extra-files": ["README.md"]
}
},
"changelog-sections": [
{
"type": "fix",
"section": "🐛 Bug Fixes"
},
{
"type": "feat",
"section": "✨ New Features"
},
{
"type": "chore",
"section": "🧹 Chore"
},
{
"type": "docs",
"section": "📚 Documentation"
},
{
"type": "perf",
"section": "🚀 Performance"
},
{
"type": "build",
"hidden": true,
"section": "🛠️ Build"
},
{
"type": "deps",
"section": "📦 Dependencies"
},
{
"type": "ci",
"hidden": true,
"section": "🚦 CI"
},
{
"type": "refactor",
"section": "🔄 Refactoring"
},
{
"type": "revert",
"section": "🔙 Reverts"
},
{
"type": "style",
"hidden": true,
"section": "🎨 Styling"
},
{
"type": "test",
"hidden": true,
"section": "🧪 Tests"
}
],
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
Loading