2024 Clojure 调查!(调查结果)中分享您的想法!

欢迎!有关本工作方式的一些额外信息,请参阅关于页面。

+2
工具
编辑

由于某种原因,我无法使用 GitHub Actions 来部署 Clojars。这是执行该操作的脚本。

  - 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

它始终告诉我它找不到凭证。

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 个回答

+1
0
by

我可能错了,但凭证不应该是放在 "~/.lein/credentials.clj " 里面吗?

我就是把我的凭证放在那里。

格式如下

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

by
我正在按照 leiningen 文档所说的做。
by
结果重复了...
0
by

你还可以直接使用环境变量。 这里 有一个供发布到 clojars 的 github 工作流程。

相关片段

- name: Publish
  env:
    CLOJARS_USER: ${{ secrets.CLOJARS_USER }}
    CLOJARS_PASS: ${{ secrets.CLOJARS_PASS }}
  run: lein deploy clojars
by
他还在遇到相同的问题。看看我的工作流程

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

非常感谢您的努力!

编辑了
我的项目.clj 中也有

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


您的错误信息似乎与 sign-releases 有关。
...