Skip to content

Commit

Permalink
Document publishing process (#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
sstone authored Sep 25, 2023
1 parent ce4e44f commit 4d20dd1
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
32 changes: 32 additions & 0 deletions publishing/PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Publishing lightning-kmp artifacts

## snapshots

Snapshots are published to the Sonatype snapshot repository (https://oss.sonatype.org/content/repositories/snapshots/).
To publish snapshots, you must add your sonatype credentials for the `ossrh` server to your local maven settings (typically in $HOME/.m2/settings.xml)

- Download `snapshot.zip` generated by the `Publish snapshot` github action
- unzip `snapshot.zip` in the `publishing` directory
- run `lightning-kmp-snapshot-deploy.sh`

For example:

```shell
$ VERSION=1.2.3-SNAPSHOT ./lightning-kmp-snapshot-deploy.sh
```

## releases

Releases are published to the Sonatype staging repository. If all items are valid they will be published to `maven central` repository.

- Download `release.zip` generated by the `Publish release` github action (which is triggered every time you publish a github release)
- unzip `release.zip` in the `publishing` directory
- sign all artifacts with a valid gpg key: `find release -type f -print -exec gpg -ab {} \;`
- run `lightning-kmp-staging-upload.sh`
- log into sonatype, close and publish your staging repository. Artifacts will be available on Maven Central within a few hours.

For example:

```shell
$ VERSION=1.2.3 OSS_USER=my_sonatype_username ./lightning-kmp-staging-upload.sh
```
31 changes: 31 additions & 0 deletions publishing/lightning-kmp-staging-upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash -x
#
# first you must sign all files with something like:
# find release -type f -print -exec gpg -ab {} \;
#

if [[ -z "${VERSION}" ]]; then
echo "VERSION is not defined"
exit 1
fi

if [[ -z "${OSS_USER}" ]]; then
echo "OSS_USER is not defined"
exit 1
fi

read -p "Password : " -s OSS_PASSWORD

for i in lightning-kmp \
lightning-kmp-iosarm64 \
lightning-kmp-iosx64 \
lightning-kmp-jvm \
lightning-kmp-linux
do
pushd .
cd release/fr/acinq/lightning/$i/$VERSION &&\
pwd &&\
jar -cvf bundle.jar *&&\
curl -v -XPOST -u $OSS_USER:$OSS_PASSWORD --upload-file bundle.jar https://oss.sonatype.org/service/local/staging/bundle_upload
popd
done

0 comments on commit 4d20dd1

Please sign in to comment.