Skip to content

Commit

Permalink
improving scripts/deploy_gem.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
adipasquale committed Mar 17, 2023
1 parent 8fdae98 commit 0c4d80a
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions scripts/deploy_gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,23 @@
version_without_v = match_data[1]
version_with_v = "v#{version_without_v}"

`sed -E -i '' "s/[0-9]+.[0-9]+.[0-9]+/#{version_without_v}/" lib/dsfr/components/version.rb`
commands = <<~BASH.split("\n")
sed -E -i '' "s/[0-9]+.[0-9]+.[0-9]+/#{version_without_v}/" lib/dsfr/components/version.rb
bundle
git add lib/dsfr/components/version.rb Gemfile.lock
git commit -m "release version #{version_with_v}"
gem build dsfr-view-components.gemspec
git tag -a "#{version_with_v}" -m "release version #{version_with_v}"
git push
git push origin "#{version_with_v}"
gh release create "#{version_with_v}" --verify-tag --generate-notes
gem push dsfr-view-components-#{version_without_v}.gem
BASH

`git add lib/dsfr/components/version.rb`
`git commit -m "release version #{version_with_v}"`
`gem build dsfr-view-components.gemspec`
`git tag -a "#{version_with_v}" -m "release version #{version_with_v}"`
`git push`
`git push origin "#{version_with_v}"`
`gh release create "#{version_with_v}" --verify-tag`
`gem push dsfr-view-components-#{version_without_v}.gem`
commands.each do |command|
puts command
res = system(command)
raise Exception, "command failed!" unless res

puts
end

0 comments on commit 0c4d80a

Please sign in to comment.