Skip to content

Commit

Permalink
Fixed version.txt generation
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx committed Jul 8, 2023
1 parent bbdb43d commit 0b6e2b4
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@ jobs:
make -j4
make install
- name: Install bundler
- name: Install bundle
run: |
gem install bundler
bundle install
bundle exec rake generate_version_txt
- name: Create deps folder
run: mkdir ${{ env.DEPS }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ jobs:
- name: tebako setup
run: |
bundle install
bundle exec rake generate_version_txt
${{ github.workspace }}/exe/tebako setup
tests-1:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ jobs:
- name: tebako setup
run: |
bundle install
bundle exec rake generate_version_txt
${{ github.workspace }}/exe/tebako setup
tests-1:
Expand Down
10 changes: 10 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,13 @@ require "rubocop/rake_task"
RuboCop::RakeTask.new

task default: %i[rubocop]

desc "Generate version.txt"
task "generate_version_txt" do
require_relative "lib/tebako/version"
File.write(File.join(__dir__, "version.txt"), "#{Tebako::VERSION}\n")
puts "Generate version.txt #{Tebako::VERSION} ==> #{File.join(__dir__, "version.txt")}"
end

task build: :generate_version_txt
task release: :generate_version_txt
8 changes: 0 additions & 8 deletions lib/tebako/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ def options
defaults = ::YAML.load_file(OPTIONS_FILE) || {}
Thor::CoreExt::HashWithIndifferentAccess.new(defaults.merge(original_options))
end

def generate
FileUtils.mkdir_p(prefix)
File.write(File.join(prefix, "version.txt"), "#{Tebako::VERSION}\n")
puts("all: ")
end
end

private
Expand All @@ -111,8 +105,6 @@ def do_press
end

def do_setup
FileUtils.mkdir_p(prefix)
File.write(File.join(prefix, "version.txt"), "#{Tebako::VERSION}\n")
packaging_error(101) unless system(b_env, "cmake -DSETUP_MODE:BOOLEAN=ON #{cfg_options}")
packaging_error(102) unless system(b_env,
"cmake --build #{output} --target setup --parallel #{Etc.nprocessors}")
Expand Down
2 changes: 1 addition & 1 deletion lib/tebako/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
# POSSIBILITY OF SUCH DAMAGE.

module Tebako
VERSION = "0.5.1"
VERSION = "0.5.2"
end
3 changes: 3 additions & 0 deletions tebako.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ Gem::Specification.new do |spec|
f.match(%r{\A(?:(?:test|spec|features|deps|output|common\.env)/|\.(?:git|cirrus|tebako|rubocop))})
end
end

spec.files << "version.txt"

spec.bindir = "exe"
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = %w[cmake exe ext include lib resources src tools/ci-scripts tools/cmake-scripts tools/includes]
Expand Down
5 changes: 3 additions & 2 deletions tests-2/tebako-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,12 @@ def test_102_launcher_stdinredir
# -- that we are linking to known set of shared libraries (https://github.com/tamatebako/tebako/issues/42)

def expected_libs
if RbConfig::CONFIG["target_os"] =~ /darwin/
case RbConfig::CONFIG["target_os"]
when /darwin/
["Security.framework", "Foundation.framework", "CoreFoundation.framework", "libSystem",
"libc++", "launcher-package-package:"]
# This is the test program itself: 'launcher-package-package:'
elsif RbConfig::CONFIG["target_os"] =~ /linux-musl/
when /linux-musl/
["libc.musl-x86_64.so", "ld-musl-x86_64.so"]
else # linux-gnu assumed
["linux-vdso.so", "libpthread.so", "libdl.so", "libc.so", "ld-linux-", "libm.so",
Expand Down

0 comments on commit 0b6e2b4

Please sign in to comment.