Skip to content

Commit 8b60d40

Browse files
committed
Revised GPG import stuff to try to workaround pinentry issues
1 parent 13dc199 commit 8b60d40

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

Diff for: .github/workflows/ci.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,11 @@ jobs:
101101
~/Library/Caches/Coursier/v1
102102
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
103103

104-
- name: Export GPG_TTY
105-
run: echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
106-
107104
- name: Import signing key
108-
run: echo $PGP_SECRET | base64 -d | gpg --import
109-
110-
- name: Hack pinentry to use PGP_PASSPHRASE
111105
env:
112106
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
113-
run: echo "$PGP_PASSPHRASE" | gpg --batch --yes --passphrase-fd 0 build.sbt &> /dev/null
107+
run: |
108+
echo "$PGP_SECRET" | base64 -d > /tmp/signing-key.gpg
109+
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
114110
115111
- run: sbt ++${{ matrix.scala }} release

Diff for: build.sbt

+6-7
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,13 @@ ThisBuild / spiewakMainBranches := Seq("main")
7979
ThisBuild / githubWorkflowArtifactUpload := false
8080

8181
// we can remove this once we have a non-password-protected key in the secrets
82-
ThisBuild / githubWorkflowPublishPreamble :=
83-
WorkflowStep.ComputeVar("GPG_TTY", "tty") +: (ThisBuild / githubWorkflowPublishPreamble).value
84-
85-
ThisBuild / githubWorkflowPublishPreamble +=
82+
ThisBuild / githubWorkflowPublishPreamble := Seq(
8683
WorkflowStep.Run(
87-
List("echo \"$PGP_PASSPHRASE\" | gpg --batch --yes --passphrase-fd 0 build.sbt &> /dev/null"),
88-
name = Some("Hack pinentry to use PGP_PASSPHRASE"),
89-
env = Map("PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}"))
84+
List(
85+
"echo \"$PGP_SECRET\" | base64 -d > /tmp/signing-key.gpg",
86+
"echo \"$PGP_PASSPHRASE\" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg"),
87+
name = Some("Import signing key"),
88+
env = Map("PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}")))
9089

9190
// environments
9291

0 commit comments

Comments
 (0)