Skip to content

Commit

Permalink
build: Make publishing compatible with act GHA simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
nightscape committed Dec 5, 2024
1 parent 430bb02 commit a7adf64
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,19 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-mill-cache-v2-${{ hashFiles('**/*.mill') }}-${{ hashFiles('project/build.properties') }}

- name: Import signing key
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
run: echo $PGP_SECRET | base64 -di | gpg --import

- name: Import signing key and strip passphrase
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
run: |
echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
(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)
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.PGP_SECRET }}
passphrase: ${{ secrets.PGP_PASSPHRASE }}
trust_level: 5

- name: Publish
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)
run: |
export GPG_TTY=$(tty)
./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)
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ project/metals.sbt
**/.bloop/
.vscode
private-key.pem
.secrets
.~lock.*.xlsx#

0 comments on commit a7adf64

Please sign in to comment.