Skip to content

Commit

Permalink
Create sorbet-static-and-runtime gem (sorbet#4460)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Terrasa <[email protected]>
  • Loading branch information
Morriar authored Jan 12, 2022
1 parent b2e830e commit 00cb102
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .buildkite/build-sorbet-static-and-runtime.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -eo pipefail

pushd gems/sorbet-static-and-runtime

echo "--- setup :ruby:"
eval "$(rbenv init -)"

runtime_versions=(2.6.3 2.7.2)

for runtime_version in "${runtime_versions[@]}"; do
rbenv install --skip-existing "$runtime_version"
rbenv shell "$runtime_version"
done

echo "--- build"
git_commit_count=$(git rev-list --count HEAD)
release_version="0.5.${git_commit_count}"
sed -i.bak "s/0\\.0\\.0/${release_version}/" sorbet-static-and-runtime.gemspec
gem build sorbet-static-and-runtime.gemspec

popd

rm -rf _out_
mkdir -p _out_/gems/
cp gems/sorbet-static-and-runtime/sorbet-static-and-runtime-*.gem _out_/gems/
5 changes: 5 additions & 0 deletions .buildkite/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ steps:
artifact_paths: _out_/**/*
<<: *elastic

- label: ":linux: build-sorbet-static-and-runtime.sh"
command: .buildkite/build-sorbet-static-and-runtime.sh
artifact_paths: _out_/**/*
<<: *elastic

- label: ":linux: build-emscripten.sh"
command: .buildkite/build-emscripten.sh
artifact_paths: _out_/**/*
Expand Down
8 changes: 8 additions & 0 deletions .buildkite/publish-ruby-gems.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,11 @@ if ! gem list --remote rubygems.org --exact 'sorbet' | grep -q "$release_version
else
echo "$gem_archive already published."
fi

gem_archive="_out_/gems/sorbet-static-and-runtime-$release_version.gem"
echo "Attempting to publish $gem_archive"
if ! gem list --remote rubygems.org --exact 'sorbet-static-and-runtime' | grep -q "$release_version"; then
with_backoff gem push --verbose "$gem_archive"
else
echo "$gem_archive already published."
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
gems/sorbet/Gemfile.lock
gems/sorbet-static/Gemfile.lock
gems/sorbet-runtime/Gemfile.lock
gems/sorbet-static-and-runtime/Gemfile.lock
*.gem

# To distribute sorbet, we copy the built C++ binary here.
Expand Down
3 changes: 3 additions & 0 deletions gems/sorbet-static-and-runtime/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# gems/sorbet-static-and-runtime/

A simple gem depending on both `sorbet` and `sorbet-runtime` making it easier for Dependabot to update Sorbet.
18 changes: 18 additions & 0 deletions gems/sorbet-static-and-runtime/sorbet-static-and-runtime.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Gem::Specification.new do |s|
s.name = 'sorbet-static-and-runtime'
s.version = '0.0.0'
s.summary = 'A Typechecker for Ruby'
s.description = 'Sorbet static and runtime in one gem'
s.authors = ['Stripe']
s.email = '[email protected]'
s.homepage = 'https://sorbet.org'
s.license = 'Apache-2.0'
s.metadata = {
'source_code_uri' => 'https://github.com/sorbet/sorbet'
}

s.add_dependency 'sorbet', '0.0.0'
s.add_dependency 'sorbet-runtime', '0.0.0'

s.required_ruby_version = ['>= 2.3.0']
end

0 comments on commit 00cb102

Please sign in to comment.