Skip to content

Commit f7f21b4

Browse files
committed
simplify gpg setup
1 parent 1765a7b commit f7f21b4

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

.github/scripts/gpg-setup.sh

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
11
#!/usr/bin/env bash
22
set -e
33

4-
# Create .gnupg directory with proper permissions
5-
mkdir -p ~/.gnupg
6-
chmod 700 ~/.gnupg
7-
8-
# Configure GPG for non-interactive use
9-
echo "use-agent" >> ~/.gnupg/gpg.conf
10-
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
11-
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
12-
13-
# Set proper permissions on GPG config files
14-
chmod 600 ~/.gnupg/gpg.conf ~/.gnupg/gpg-agent.conf
15-
16-
# Reload the GPG agent
17-
echo RELOADAGENT | gpg-connect-agent
18-
194
# Import the PGP secret key
205
echo "$PGP_SECRET" | base64 --decode | gpg --import --no-tty --batch --yes

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ on:
1515
tags: [v*]
1616

1717
env:
18-
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
1920
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
2021
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
21-
PGP_SECRET: ${{ secrets.PGP_SECRET }}
22-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2322

2423
jobs:
2524
build:

build.sbt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ ThisBuild / githubWorkflowPublish := Seq(
4343
WorkflowStep.Run(List(".github/scripts/gpg-setup.sh"), name = Some("Import GPG key")),
4444
WorkflowStep.Sbt(List("ci-release"))
4545
)
46-
ThisBuild / githubWorkflowEnv ++= List("PGP_PASSPHRASE", "PGP_SECRET", "SONATYPE_PASSWORD", "SONATYPE_USERNAME").map { envKey =>
46+
47+
ThisBuild / githubWorkflowEnv ++= List("PGP_SECRET", "SONATYPE_PASSWORD", "SONATYPE_USERNAME").map { envKey =>
4748
envKey -> s"$${{ secrets.$envKey }}"
4849
}.toMap
4950

0 commit comments

Comments
 (0)