Skip to content

Commit a7adf64

Browse files
committed
build: Make publishing compatible with act GHA simulator
1 parent 430bb02 commit a7adf64

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

.github/workflows/ci.yml

+14-11
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,19 @@ jobs:
121121
~/Library/Caches/Coursier/v1
122122
key: ${{ runner.os }}-mill-cache-v2-${{ hashFiles('**/*.mill') }}-${{ hashFiles('project/build.properties') }}
123123

124-
- name: Import signing key
125-
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
126-
run: echo $PGP_SECRET | base64 -di | gpg --import
127-
128-
- name: Import signing key and strip passphrase
129-
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
130-
run: |
131-
echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg
132-
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
133-
(echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)
124+
- name: Import GPG Key
125+
uses: crazy-max/ghaction-import-gpg@v6
126+
with:
127+
gpg_private_key: ${{ secrets.PGP_SECRET }}
128+
passphrase: ${{ secrets.PGP_PASSPHRASE }}
129+
trust_level: 5
134130

135131
- name: Publish
136-
run: ./mill -i mill.contrib.sonatypecentral.SonatypeCentralPublishModule/publishAll --publishArtifacts __.publishArtifacts --username $SONATYPE_USERNAME --password $SONATYPE_PASSWORD --gpgArgs "--passphrase=$PGP_PASSPHRASE,--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b" --bundleName dev.mauch-spark-excel-$(date +%Y-%m-%d-%H-%M)
132+
run: |
133+
export GPG_TTY=$(tty)
134+
./mill -i mill.contrib.sonatypecentral.SonatypeCentralPublishModule/publishAll \
135+
--publishArtifacts __.publishArtifacts \
136+
--username $SONATYPE_USERNAME \
137+
--password $SONATYPE_PASSWORD \
138+
--gpgArgs "--passphrase=$PGP_PASSPHRASE,--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b" \
139+
--bundleName dev.mauch-spark-excel-$(date +%Y-%m-%d-%H-%M)

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ project/metals.sbt
1414
**/.bloop/
1515
.vscode
1616
private-key.pem
17+
.secrets
1718
.~lock.*.xlsx#

0 commit comments

Comments
 (0)