Skip to content
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

feat: automate clojars releases for release tags with travis-ci #474

Merged
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
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ script:
- lein test
- lein test :generative
- lein with-profile dev,recent-clj test
deploy:
provider: script
script: lein deploy clojars
on:
tags: true
all_branches: false
condition: $TRAVIS_TAG =~ ^(\d+)\.(\d+)\.(\d+)(-.+)?$
# Workaround for https://github.com/travis-ci/travis-ci/issues/4691
sudo: required
jdk:
Expand Down
6 changes: 5 additions & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,8 @@
[:name "Ryan Brush"]
[:url "http://www.clara-rules.org"]]]
:deploy-repositories [["snapshots" {:url "https://oss.sonatype.org/content/repositories/snapshots/"
:creds :gpg}]])
:creds :gpg}]
["clojars" {:url "https://repo.clojars.org"
:username :env/clojars_username
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From some quick googling it looks like we'll need these variables to be added using the instructions at https://docs.travis-ci.com/user/environment-variables/#encrypting-environment-variables. Is that what you're thinking? I could have missed something of course, I haven't looked at the travis docs in much depth to be honest.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WilliamParker yes, I have already added the variables from the build configuration in Travis CI console

:password :env/clojars_password
:sign-releases false}]])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this isn't completely ideal, but since we (at least I) haven't published the GPG key I used to manually deploy in reality it isn't much different from what we've done before. Also in practice it would be quite obvious if releases that didn't have a corresponding tag were created and since nobody has ever asked about signature on the jars I'm guessing it isn't checked. So basically I think this is OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this would be fine as well, if someone has an issue with jar signing in the future we can open a new issue and find a way to get GPG working on the CI environment but I don't think that will be the case.