Skip to content

Commit

Permalink
feat: adding gem generation
Browse files Browse the repository at this point in the history
  • Loading branch information
romainfd committed Sep 26, 2024
1 parent 223636b commit 43ced39
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/generate-sdks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: |
rm -r ruby python csharp || true
- name: Generate Ruby classes
- name: [Ruby] Generate classes
working-directory: ./generator
run: |
npx @openapitools/openapi-generator-cli generate -c ./config/EDXL-DE/ruby/EDXL-DE.generator-config.json --skip-validate-spec
Expand All @@ -46,12 +46,34 @@ jobs:
npx @openapitools/openapi-generator-cli generate -c ./config/$SCHEMA/ruby/$SCHEMA.generator-config.json --skip-validate-spec
done
- name: Generate Python classes
- name: [Ruby] Move classes to SDK folder
run: |
rm -r sdks/ruby/lib || true
mv generator/ruby/ruby_classes/lib sdks/ruby/
- name: [Ruby] Set up
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true

- name: [Ruby] Build gem
working-directory: ./sdks/ruby/
run: gem build hubsante_model.gemspec

- name: [Ruby] Push gem to GitHub Packages
working-directory: ./sdks/ruby/
run: |
gem push --key github --host https://rubygems.pkg.github.com/ansforge ./hubsante_model-TEST.gem
env:
GEM_HOST_API_KEY: ${{ secrets.GITHUB_TOKEN }} # GitHub token used to authenticate

- name: [Python] Generate classes
working-directory: ./generator
run: |
npx @openapitools/openapi-generator-cli generate -c ./config/RS-EDA/python/RS-EDA.generator-config.json --skip-validate-spec
- name: Generate C# classes
- name: [C#] Generate classes
working-directory: ./generator
run: |
npx @openapitools/openapi-generator-cli generate -c ./config/RS-EDA/csharp/RS-EDA.generator-config.json --skip-validate-spec
Expand Down
21 changes: 21 additions & 0 deletions sdks/ruby/hubsante_model.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Gem::Specification.new do |spec|
spec.name = "hubsante_model"
spec.version = "1.0"
spec.authors = ["Hub Santé"]
spec.email = ["[email protected]"]

spec.summary = ""
spec.description = ""
spec.homepage = "https://github.com/ansforge/SAMU-Hub-Modeles"
spec.metadata = {
"source_code_uri" => "https://github.com/ansforge/SAMU-Hub-Modeles"
}

spec.files = Dir["lib/**/*.rb"]
spec.license = "MIT"

spec.required_ruby_version = ">= 3.0.0"

# Dépendencies
spec.add_dependency "rails", "~> 7.1"
end

0 comments on commit 43ced39

Please sign in to comment.