2020 runs-on : ubuntu-22.04
2121 outputs :
2222 gem_version : ${{ steps.build_gem.outputs.gem_version }}
23+ otel_gem_version : ${{ steps.build_otel_gem.outputs.otel_gem_version }}
2324 steps :
2425 - uses : actions/checkout@v4
2526 with :
@@ -30,15 +31,22 @@ jobs:
3031 with :
3132 ruby-version : 3.3
3233 bundler-cache : true
33- - name : Build
34+ - name : Build couchbase gem
3435 id : build_gem
3536 run : |
3637 COMMITS_SINCE_LAST_TAG=$(git describe --tags --always --long | awk -F '-' '{print $2}')
3738 ruby bin/jenkins/patch-version.rb ${COMMITS_SINCE_LAST_TAG}
3839 GEM_VERSION=$(ruby -r ./lib/couchbase/version.rb -e "puts Couchbase::VERSION[:sdk]")
3940 echo "gem_version=${GEM_VERSION}" >> "$GITHUB_OUTPUT"
4041 bundle exec rake build
41- - name : RDoc
42+ - name : Build couchbase-opentelemetry gem
43+ id : build_otel_gem
44+ run : |
45+ cd couchbase-opentelemetry
46+ OTEL_GEM_VERSION=$(ruby -r ./lib/couchbase/opentelemetry/version.rb -e "puts Couchbase::OpenTelemetry::VERSION")
47+ echo "otel_gem_version=${OTEL_GEM_VERSION}" >> "$GITHUB_OUTPUT"
48+ bundle exec rake build
49+ - name : Generate documentation for the couchbase gem
4250 run : |
4351 cat > patch-readme.rb <<EOF
4452 require_relative "./lib/couchbase/version.rb"
@@ -50,36 +58,66 @@ jobs:
5058 File.write("README.md", new_content)
5159 EOF
5260 ruby patch-readme.rb
53- bundle exec yard doc --hide-api private --output-dir docs/couchbase-ruby-client-${{ steps.build_gem.outputs.gem_version }} lib --main README.md
54- - uses : actions/upload-artifact@v4
61+ bundle exec rake doc
62+ - name : Generate documentation for the couchbase-opentelemetry gem
63+ run : |
64+ cd couchbase-opentelemetry
65+ cat > patch-readme.rb <<EOF
66+ require_relative "./lib/couchbase/opentelemetry/version.rb"
67+ gemfile = <<EOS.strip
68+ gem "couchbase-opentelemetry", "#{Couchbase::OpenTelemetry::VERSION}"
69+ EOS
70+ old_content = File.read("README.md")
71+ new_content = old_content.gsub(/(gem "couchbase-opentelemetry", ").*?"/, gemfile)
72+ File.write("README.md", new_content)
73+ EOF
74+ ruby patch-readme.rb
75+ bundle exec rake doc
76+ - name : Upload artifact - couchbase gem
77+ uses : actions/upload-artifact@v4
5578 with :
5679 name : couchbase-${{ steps.build_gem.outputs.gem_version }}
5780 path : |
5881 pkg/*.gem
59- - uses : actions/upload-artifact@v4
82+ - name : Upload artifact - couchbase-opentelemetry gem
83+ uses : actions/upload-artifact@v4
84+ with :
85+ name : couchbase-opentelemetry-${{ steps.build_otel_gem.outputs.otel_gem_version }}
86+ path : |
87+ couchbase-opentelemetry/pkg/*.gem
88+ - name : Upload artifact - scripts
89+ uses : actions/upload-artifact@v4
6090 with :
6191 retention-days : 1
6292 name : scripts-${{ steps.build_gem.outputs.gem_version }}
6393 path : |
64- Gemfile
6594 Rakefile
95+ couchbase*.gemspec
96+ lib/couchbase/**/version.rb
97+ Gemfile
6698 bin/**/*
67- couchbase.gemspec
68- lib/couchbase/version.rb
6999 task/**/*
70- - uses : actions/upload-artifact@v4
100+ - name : Upload artifact - tests and test data
101+ uses : actions/upload-artifact@v4
71102 with :
72103 retention-days : 1
73104 name : tests-${{ steps.build_gem.outputs.gem_version }}
74105 path : |
75106 test/**/*
76107 test_data/**/*
77- - uses : actions/upload-artifact@v4
108+ - name : Upload artifact - couchbase gem docs
109+ uses : actions/upload-artifact@v4
78110 with :
79111 name : docs-${{ steps.build_gem.outputs.gem_version }}
80112 path : |
81- docs/**/*
82-
113+ doc/**/*
114+ - name : Upload artifact - couchbase-opentelemetry gem docs
115+ uses : actions/upload-artifact@v4
116+ with :
117+ name : otel-docs-${{ steps.build_otel_gem.outputs.otel_gem_version }}
118+ path : |
119+ couchbase-opentelemetry/doc/**/*
120+
83121 build_alpine_x86_64 :
84122 # FIXME(SA): add aarch64 for Alpine Linux
85123 # Right now github does not allow to execute JS-based actions (like
0 commit comments