Skip to content

Commit e31b4a0

Browse files
committed
Set up publish
1 parent 360ee1d commit e31b4a0

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

.github/workflows/ci.yml

+35-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
name: CI
22

33
on:
4-
push:
54
pull_request:
5+
branches: ["*"]
6+
push:
7+
branches: ["main"]
8+
tags: ["v*"]
9+
10+
concurrency:
11+
group: ci-${{ github.ref }}
12+
cancel-in-progress: true
13+
614

715
jobs:
816
build:
917
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: true
1020

1121
steps:
1222
- name: Checkout
@@ -31,3 +41,27 @@ jobs:
3141
mill -k --disable-ticker __.resolvedIvyDeps &&
3242
mill -j 0 -k --disable-ticker __.checkFormat &&
3343
mill -j 0 -k --disable-ticker __.test
44+
45+
- name: Set up GPG
46+
if: startsWith(github.ref, 'refs/tags/v')
47+
run: |
48+
mkdir ~/.gnupg && chmod 700 ~/.gnupg
49+
echo use-agent >> ~/.gnupg/gpg.conf
50+
echo pinentry-mode loopback >> ~/.gnupg/gpg.conf
51+
echo allow-loopback-pinentry >> ~/.gnupg/gpg-agent.conf
52+
chmod 600 ~/.gnupg/*
53+
echo RELOADAGENT | gpg-connect-agent
54+
echo $PGP_SECRET | base64 --decode | gpg --import --no-tty --batch --yes
55+
env:
56+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
57+
58+
- name: Publish release
59+
if: startsWith(github.ref, 'refs/tags/v')
60+
run: |
61+
export GPG_TTY=$(tty)
62+
mill -j 0 -k --disable-ticker mill.scalalib.PublishModule/publishAll \
63+
--publishArtifacts __.publishArtifacts \
64+
--sonatypeCreds ${{ secrets.SONATYPE_USERNAME }}:${{secrets.SONATYPE_PASSWORD }} \
65+
--gpgArgs '--passphrase=${{ secrets.PGP_PASSPHRASE }},--batch,--yes,-a,-b' \
66+
--signed true \
67+
--release true

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![CI](https://github.com/neandertech/jsonrpclib/actions/workflows/ci.yml/badge.svg)](https://github.com/neandertech/jsonrpclib/actions/workflows/ci.yml)
2+
13
# jsonrpclib
24

35
This is a cross-platform, cross-scala-version [jsonrpc](https://www.jsonrpc.org/) library that provides construct for bidirectional communication using

0 commit comments

Comments
 (0)