Share your thoughts in the 2024 State of Clojure Survey!

Welcome! Please see the About page for a little more info on how this works.

+2 votes
in Tools by
edited by

For some reason that I can't find, it's impossible for me to deploy Clojars using Github Actions. This is my script where I perform the action.

  - name: Deploy clojars
      run: |
        mkdir ~/.lein
        echo '{:user {} :auth {:repository-auth{#"clojars" {:username "${{ secrets.CLOJARS_USERNAME }}" :password "${{ secrets.CLOJARS_PASSWORD }}" :sign-releases false }}}}' > ~/.lein/profiles.clj
        lein deploy clojars

He's always telling me he can't find the credentials.

No credentials found for clojars
    See `lein help deploying` for how to configure credentials to avoid prompts.
    Username: LEIN IS UNABLE TO TURN OFF ECHOING, SO THE PASSWORD IS PRINTED TO THE CONSOLE
    Password: Created /home/runner/work/tadam-core/tadam-core/target/tadam-core-0.3.0.jar
    Wrote /home/runner/work/tadam-core/tadam-core/pom.xml
    Need to sign 2 files with GPG
    [1/2] Signing /home/runner/work/tadam-core/tadam-core/target/tadam-core-0.3.0.jar with GPG
    gpg: directory '/home/runner/.gnupg' created
    gpg: keybox '/home/runner/.gnupg/pubring.kbx' created
    gpg: no default secret key: No secret key
    gpg: signing failed: No secret key
    Could not sign /home/runner/work/tadam-core/tadam-core/target/tadam-core-0.3.0.jar
    gpg: directory '/home/runner/.gnupg' created
    gpg: keybox '/home/runner/.gnupg/pubring.kbx' created
    gpg: no default secret key: No secret key
    gpg: signing failed: No secret key
    
    
    See `lein help gpg` for how to set up gpg.
    If you don't expect people to need to verify the authorship of your jar, you
    can add `:sign-releases false` to the relevant `:deploy-repositories` entry.
    ##[error]Process completed with exit code 1.

3 Answers

0 votes
by

I might be wrong, but shouldn't the credentials go in "~/.lein/credentials.clj " ?

That's where I store mine.

format is:

#"https://repo.clojars.org"
{:username "YOUR_USER" :password "YOUR_PASS"}}

by
I'm doing what the leiningen doc says.
by
The results are repeated...
0 votes
by

You can also just use the env. here is a github workflow for publishing to clojars.

Relevant snippet:

- name: Publish
  env:
    CLOJARS_USER: ${{ secrets.CLOJARS_USER }}
    CLOJARS_PASS: ${{ secrets.CLOJARS_PASS }}
  run: lein deploy clojars
by
He's still having the same problem . Look at my workflow:

https://github.com/tadam-framework/tadam-core/blob/master/.github/workflows/deploy.yml

Thank you very much for the effort!
by
edited by
In my project.clj, I also have:

    :deploy-repositories [["clojars" {
                                    :url "https://clojars.org/repo"
                                    :username :env/clojars_user
                                    :password  :env/clojars_pass
                                    :sign-releases false}]]


Your error message appears to be related to the sign-releases.
...