diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 9136189..52cad27 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -64,6 +64,10 @@ A helper script is available to build and push all gems in one go: ruby scripts/publish_gems.rb ``` +The list of target triples used by the script lives in +`scripts/targets.txt`. You can override it by passing targets as +arguments to the helper script. + ### Native extension gem 1. Install the development dependencies: diff --git a/scripts/publish_gems.rb b/scripts/publish_gems.rb index 38b7fa2..21330f9 100644 --- a/scripts/publish_gems.rb +++ b/scripts/publish_gems.rb @@ -3,14 +3,20 @@ require 'fileutils' -TARGETS = [ - 'x86_64-unknown-linux-gnu', - 'aarch64-unknown-linux-gnu', - 'x86_64-apple-darwin', - 'aarch64-apple-darwin', - 'x86_64-pc-windows-msvc' -].freeze +def load_targets + return ARGV unless ARGV.empty? + config_path = File.join(__dir__, 'targets.txt') + unless File.exist?(config_path) + abort("No targets specified and #{config_path} is missing") + end + + File.readlines(config_path, chomp: true) + .map { |l| l.strip } + .reject { |l| l.empty? || l.start_with?('#') } +end + +TARGETS = load_targets.freeze def run(cmd, env = {}) command = env.map { |k, v| "#{k}=#{v}" }.join(' ') diff --git a/scripts/targets.txt b/scripts/targets.txt new file mode 100644 index 0000000..9228f1e --- /dev/null +++ b/scripts/targets.txt @@ -0,0 +1,5 @@ +x86_64-unknown-linux-gnu +aarch64-unknown-linux-gnu +x86_64-apple-darwin +aarch64-apple-darwin +x86_64-pc-windows-msvc