Skip to content

Commit

Permalink
try more things
Browse files Browse the repository at this point in the history
  • Loading branch information
keynmol committed Jun 21, 2024
1 parent 7935c5c commit 7e1c62d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,19 @@ jobs:
- name: Check documentation compiles and runs
run: make check-docs && make run-example

- name: Publish
if: startsWith(github.ref, 'refs/tags/v') || (github.ref == 'refs/heads/main')
- name: Publish snapshot
if: github.ref == 'refs/heads/main'
run: make publish-snapshot
env:
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

- name: Publish
if: startsWith(github.ref, 'refs/tags/v')
run: make publish
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}


9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ check-docs:
test:
scala-cli test .

publish-snapshot:
scala-cli config publish.credentials s01.oss.sonatype.org env:SONATYPE_USER env:SONATYPE_PASSWORD
scala-cli publish . -S 3.3.3 --signer none

publish:
scala-cli config publish.credentials s01.oss.sonatype.org env:SONATYPE_USER env:SONATYPE_PASSWORD
scala-cli publish . -S 3.3.3
echo "$PGP_SECRET" | base64 -d -i - > /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)
scala-cli publish . -S 3.3.3 --signer gpg --gpg-key 15A7215B6CD4016A

code-check:
scala-cli fmt . --check
Expand Down

0 comments on commit 7e1c62d

Please sign in to comment.