1
0
Fork 0
mirror of https://github.com/rubyjs/libv8 synced 2023-03-27 23:21:48 -04:00

Revamp Travis configuration files for automatic deployment

We now build against three darwin versions (Sierra, High Sierra and Catalina)
to match Ruby core. We continue to build against 3 ruby versions on Linux, but
we only deploy the ruby 2.7 builds (since they should all be identical).
This commit is contained in:
nightpool 2020-07-17 17:08:14 -04:00
parent 43902f09ea
commit 818cc4ef84
4 changed files with 36 additions and 47 deletions

1
.gitignore vendored
View file

@ -15,4 +15,5 @@ lib/libv8/VERSION
/release/**/.scaleway /release/**/.scaleway
/vendor/.gclient /vendor/.gclient
/vendor/.gclient_entries /vendor/.gclient_entries
/vendor/.cipd
/vendor/v8/ /vendor/v8/

View file

@ -7,10 +7,12 @@ rvm:
- 2.5 - 2.5
matrix: matrix:
include: include:
- rvm: 2.6 - os: osx
os: osx osx_image: xcode12
osx_image: xcode9.4.1 - os: osx
fast_finish: true osx_image: xcode11.3
- os: osx
osx_image: xcode10.1
addons: addons:
apt: apt:
packages: packages:
@ -25,19 +27,21 @@ before_install:
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$TRAVIS_RUBY_VERSION" != "system" ]; then gem update bundler; fi - if [ "$TRAVIS_OS_NAME" == "osx" -a "$TRAVIS_RUBY_VERSION" != "system" ]; then gem update bundler; fi
script: script:
- git submodule update --init - git submodule update --init
- bundle exec rake spec binary --trace - bundle exec rake spec binary osx_varients --trace
deploy: deploy:
provider: releases provider: releases
file: $(git ls-files -o pkg | head -1) file_glob: true
file: pkg/*.gem
api_key: api_key:
secure: OMCBceg89uRnU+FIPAPbeOK2pISvV4Cz62r9iTRIGXQCOOXX8M40i77/3DmtkMtc9FEuNyAu1+CH886PL2WtZZPK4CmEU3HuqXz1a5VsCI+zcAZL1tevKvblXOVQ3MG+B/SZRC3rEzGwjk4027WtzCCGoGCLUu4TFJP05+/8XN4= secure: OMCBceg89uRnU+FIPAPbeOK2pISvV4Cz62r9iTRIGXQCOOXX8M40i77/3DmtkMtc9FEuNyAu1+CH886PL2WtZZPK4CmEU3HuqXz1a5VsCI+zcAZL1tevKvblXOVQ3MG+B/SZRC3rEzGwjk4027WtzCCGoGCLUu4TFJP05+/8XN4=
skip_cleanup: true skip_cleanup: true
on: on:
tags: true tags: true
# condition: $TRAVIS_OS_NAME = osx rvm: '2.7' # Only deploy 1 of each platform
cache: cache:
bundler: true bundler: true
notifications: notifications:
recipients: recipients:
- cowboyd@thefrontside.net - cowboyd@thefrontside.net
- bordjukov@gmail.com - bordjukov@gmail.com
- nightpool@cybre.space

View file

@ -26,9 +26,6 @@ platforms.
* x86_64-darwin-19 * x86_64-darwin-19
* x86_64-darwin-18 * x86_64-darwin-18
* x86_64-darwin-17 * x86_64-darwin-17
* x86_64-darwin-16
* x86_64-darwin-15
* x86_64-darwin-14
* x86_64-linux * x86_64-linux
* x86-linux * x86-linux

View file

@ -20,9 +20,20 @@ DISTRIBUTIONS = [
module Helpers module Helpers
module_function module_function
def binary_gemspec(platform = Gem::Platform.local) def binary_gemspec(platform = Gem::Platform.local)
gemspec = eval(File.read 'libv8.gemspec') eval(File.read 'libv8.gemspec').tap do |gemspec|
gemspec.platform = platform gemspec.platform = platform
gemspec gemspec.extensions.clear
# We don't need most things for the binary
gemspec.files = []
gemspec.files += ['lib/libv8.rb', 'lib/libv8/version.rb']
gemspec.files += ['ext/libv8/location.rb', 'ext/libv8/paths.rb']
gemspec.files += ['ext/libv8/.location.yml']
# V8
gemspec.files += Dir['vendor/v8/include/**/*.h']
gemspec.files += Dir['vendor/v8/out.gn/**/*.a']
end
end end
def binary_gem_name(platform = Gem::Platform.local) def binary_gem_name(platform = Gem::Platform.local)
@ -37,29 +48,14 @@ end
desc "build a binary gem #{Helpers.binary_gem_name}" desc "build a binary gem #{Helpers.binary_gem_name}"
task :binary => :compile do task :binary => :compile do
require 'rubygems/package'
gemspec = Helpers.binary_gemspec gemspec = Helpers.binary_gemspec
gemspec.extensions.clear
# We don't need most things for the binary
gemspec.files = []
gemspec.files += ['lib/libv8.rb', 'lib/libv8/version.rb']
gemspec.files += ['ext/libv8/location.rb', 'ext/libv8/paths.rb']
gemspec.files += ['ext/libv8/.location.yml']
# V8
gemspec.files += Dir['vendor/v8/include/**/*.h']
gemspec.files += Dir['vendor/v8/out.gn/**/*.a']
FileUtils.chmod 0644, gemspec.files FileUtils.chmod 0644, gemspec.files
FileUtils.mkdir_p 'pkg' FileUtils.mkdir_p 'pkg'
package = if Gem::VERSION < '2.0.0' package = Gem::Package.build gemspec
Gem::Builder.new(gemspec).build
else
require 'rubygems/package'
Gem::Package.build gemspec
end
FileUtils.mv package, 'pkg' FileUtils.mv package, 'pkg'
end end
@ -110,22 +106,13 @@ end
task :default => [:compile, :spec] task :default => [:compile, :spec]
task :build => [:clean] task :build => [:clean]
task :repack, [:gemfile, :new_arch] do |t, args| desc 'Generate OSX varient platform names'
dir = Dir::mktmpdir task :osx_varients => [:compile] do
gemspec = binary_gemspec
return unless gemspec.platform == 'osx'
begin %w(x86_64 universal).each do |cpu|
sh "gem unpack #{args[:gemfile]} --target=#{dir}" gemspec.platform.cpu = cpu
sh "gem spec #{args[:gemfile]} --ruby > #{dir}/repack.gemspec" Gem::Package.build gemspec
Dir.chdir(dir) do
sh "sed -iorig 's/^ s.platform = .*$/ s.platform = \"#{args[:new_arch]}\".freeze/' repack.gemspec"
Dir.chdir(Dir.glob("libv8-*/").first) do
sh 'mv ../repack.gemspec ./'
sh 'gem build repack.gemspec'
end
end
sh "mv #{dir}/*/*.gem ./pkg/"
ensure
FileUtils.remove_entry_secure dir
end end
end end