-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automate release process with CI #45
Comments
👍 |
Here's a helpful article on the topic of releasing in one click: http://www.yegor256.com/2014/08/26/publish-to-rubygems.html |
I have good news. @ldez has figured out how to get Travis CI to do a release (at least for apm packages). I think we can build on that work for this issue. See: |
Here's the manual release process I've been following:
|
Travis can be configured to release a gem to RubyGems.org. See https://docs.travis-ci.com/user/deployment/rubygems/. I think I'm going to give that a try. |
Here's a script I hacked together to handle bumping the version and creating the release commits. #!/usr/bin/bash
PUSH=false
while getopts "p" option; do
case $option in
p) PUSH=true ;;
esac
done
GEM_VERSION=`bundle exec ruby -e "print (Gem::Version.new Jekyll::AsciiDoc::VERSION).release"`
sed -i "/VERSION/s/'[^']\+'/'$GEM_VERSION'/" lib/jekyll-asciidoc/version.rb
sed -i "3i v$GEM_VERSION, `date +%Y-%m-%d`" README.adoc
sed -i "/^:branch: master$/d" README.adoc
git commit -a -m "Prepare $GEM_VERSION release"
git commit --allow-empty -m "Release $GEM_VERSION"
git tag -m "Version $GEM_VERSION" v$GEM_VERSION
if [ $PUSH == true ]; then
git push --tags
fi
sed -i "3d" README.adoc
sed -i "s/^ifdef::env-github\[\]$/&\n:branch: master/" README.adoc
GEM_VERSION=`bundle exec ruby -e "print (Gem::Version.new Jekyll::AsciiDoc::VERSION).segments.tap {|s| s[-1] += 1 }.join('.') + '.dev'"`
sed -i "/VERSION/s/'[^']\+'/'$GEM_VERSION'/" lib/jekyll-asciidoc/version.rb
git commit -m "Begin development on next version [skip ci]" .
if [ $PUSH == true ]; then
git push
fi I find most of the release helper gems to be too complex and error prone. |
After I pushed the tag, Travis performed the release. It went off without a hitch (except for some reason Travis failed on one of the interim builds, claiming that the commit disappeared). Now that Travis releases the gem, what's next is to have Travis prepare and create the tag (including the version number swap). I'd like to be able to push a commit to master that triggers the release.sh script. I'm thinking something like:
From there, Travis runs release.sh to create the release commit and switch back to the development version after. This is where we need to setup the SSH key because we need to allow Travis to push to the repository. We may want to consolidate some of the commits too so that we don't end up with so many interim commits. We may even be able to amend the initial release commit so that it's only temporary. (Another idea would be to push a temporary branch or tag). |
Interesting to note that Travis CI now has build stages. This would allow the commit and deploy to happen in the same build. See https://docs.travis-ci.com/user/build-stages/deploy-rubygems/. I'm not sure if that will work for us, but it looks promising. |
This now done in GitHub Actions. The Release workflow drives a release starting from the web form. |
Releases should be completely (or as much as possible) automated by a CI system.
The current release process is mostly manual. This leads to slow release cycles that are prone to error. The current process is well documented in #36.
I am surely missing some items, but here is current list of actions for a release (assuming access to the
jekyll-asciidoc
RubyGem and this repository):rake release
. This accomplishes a few things:jekyll-asciidoc
RubyGemIn my opinion, I think trying to achieve a level of automated releases similar to how the spinnaker/deck would be awesome.
Related issues
The text was updated successfully, but these errors were encountered: