Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document publishing process #535

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading