Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ jobs:
sha: ${{ steps.bump.outputs.sha }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
- name: Commit the version bump (publish only)
id: bump
env:
Expand All @@ -117,7 +120,10 @@ jobs:
git config user.name feedmob-release
git config user.email release@feedmob.invalid
ruby -e "path = 'lib/feedmob/cli/version.rb'; content = File.read(path); updated = content.sub(/VERSION = '[^']+'/, %{VERSION = '#{ENV.fetch('RELEASE_VERSION')}'}); abort('VERSION assignment not found') if updated == content && !content.include?(ENV.fetch('RELEASE_VERSION')); File.write(path, updated)"
git add lib/feedmob/cli/version.rb
# The lockfile records the path gem version; a stale lockfile
# breaks frozen bundle installs in every downstream job.
bundle lock
git add lib/feedmob/cli/version.rb Gemfile.lock
git diff --cached --quiet || git commit -m "fm $RELEASE_VERSION"
git push origin HEAD:main
fi
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
feedmob-cli (0.1.0)
feedmob-cli (0.1.1)
dry-cli (~> 1.4)
fiddle (~> 1.1)

Expand Down Expand Up @@ -60,7 +60,7 @@ CHECKSUMS
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
dry-cli (1.4.1) sha256=b8015bb76c708aa8705a36faf694973e75eeeffca39b89c8e172dc6f66a7d874
feedmob-cli (0.1.0)
feedmob-cli (0.1.1)
fiddle (1.1.8) sha256=7fa8ee3627271497f3add5503acdbc3f40b32f610fc1cf49634f083ef3f32eee
json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a
language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
Expand Down
2 changes: 1 addition & 1 deletion test/installed_cli_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_local_install_runs_from_a_different_working_directory

assert_predicate status, :success?, stderr
assert_equal File.join(prefix, 'bin', 'fm'), stdout.lines.first.strip
assert_equal({ 'ok' => true, 'data' => { 'version' => '0.1.0' } }, JSON.parse(stdout.lines.last))
assert_equal({ 'ok' => true, 'data' => { 'version' => FeedMob::CLI::VERSION } }, JSON.parse(stdout.lines.last))
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/release_linux_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_release_artifact_validator_inspects_and_runs_version_smoke
assert_predicate status, :success?, "#{stdout}\n#{stderr}"
assert_includes stdout, "Top-level target: #{host_target_id}"
assert_includes stdout, 'Runtime provenance: ruby@4.0.1;tebako=0.16.4;'
assert_includes stdout, 'Version smoke: 0.1.0'
assert_includes stdout, "Version smoke: #{FeedMob::CLI::VERSION}"
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/release_macos_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_release_artifact_validator_inspects_and_runs_version_smoke
assert_predicate status, :success?, "#{stdout}\n#{stderr}"
assert_includes stdout, "Top-level target: #{host_target_id}"
assert_includes stdout, 'Runtime provenance: ruby@4.0.1;tebako=0.16.4;'
assert_includes stdout, 'Version smoke: 0.1.0'
assert_includes stdout, "Version smoke: #{FeedMob::CLI::VERSION}"
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/release_packaging_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def test_assembler_requires_exactly_four_archives_and_their_checksums
assert_equal expected_files, Dir.children(output).sort
manifest = JSON.parse(File.read(File.join(output, 'release-assets.json')))
assert_equal TARGET_IDS.sort, manifest.fetch('assets').keys.sort
assert_equal '0.1.0', manifest.fetch('version')
assert_equal FeedMob::CLI::VERSION, manifest.fetch('version')

sums = File.read(File.join(output, 'SHA256SUMS'))
assert_equal sums.lines.sort.join, sums
Expand Down
4 changes: 2 additions & 2 deletions test/release_test_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ def compile_fake_artifact(artifact, temporary_directory, extra_flags: [])
source = File.join(temporary_directory, 'fake_fm.c')
File.write(
source,
<<~'C'
<<~C
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv) {
if (argc == 3 && strcmp(argv[1], "--json") == 0 && strcmp(argv[2], "version") == 0) {
puts("{\"ok\":true,\"data\":{\"version\":\"0.1.0\"}}");
puts("{\\"ok\\":true,\\"data\\":{\\"version\\":\\"#{FeedMob::CLI::VERSION}\\"}}");
return 0;
}
return 2;
Expand Down
2 changes: 2 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
require 'stringio'

$LOAD_PATH.unshift File.expand_path('../lib', __dir__)

require 'feedmob/cli/version'
Loading