zcash-android-wallet-sdk/docs/PUBLISHING.md

49 lines
2.3 KiB
Markdown
Raw Normal View History

2021-08-19 21:44:57 -07:00
# Publishing
Two types of artifacts can be published:
1. Snapshot — An unstable release of the SDK for testing
1. Release — A stable release of the SDK
Control of these modes of release is managed with a Gradle property `IS_SNAPSHOT`, which is
For both snapshot and release deployments, there are two ways to initiate deployment:
1. Automatically — See [ci.md](ci.md), which describes the continuous integration workflow for deployment.
2. Manually — See the remainder of this document for how to configure manual deployment.
2021-08-19 21:44:57 -07:00
Publishing requires:
### One time only
* Set up environment to [compile the SDK](https://github.com/zcash/zcash-android-wallet-sdk/#compiling-sources)
2022-01-10 10:03:47 -08:00
* Copy the GPG key to a directory with proper permissions (chmod 600). Note: If you'd like to quickly publish locally without subsequently publishing to Maven Central, configure a Gradle property `RELEASE_SIGNING_ENABLED=false`
2021-08-19 21:44:57 -07:00
* Create file `~/.gradle/gradle.properties` per the [instructions in this guide](https://proandroiddev.com/publishing-a-maven-artifact-3-3-step-by-step-instructions-to-mavencentral-publishing-bd661081645d)
2022-01-10 10:03:47 -08:00
* add your sonotype credentials with these properties
* `mavenCentralUsername`
* `mavenCentralPassword`
* point it to the GPG key with these properties
* `signing.keyId`
* `signing.password`
* `signing.secretKeyRingFile`
2021-08-19 21:44:57 -07:00
### Every time
1. Update the [build number](https://github.com/zcash/zcash-android-wallet-sdk/blob/master/gradle.properties) and the [CHANGELOG](https://github.com/zcash/zcash-android-wallet-sdk/blob/master/CHANGELOG.md). For release builds, suffix the Gradle invocations below with `-PIS_SNAPSHOT=false`.
3. Build locally
* This will install the files in your local maven repo at `~/.m2/repository/cash/z/ecc/android/`
2021-08-19 21:44:57 -07:00
```zsh
./gradlew publishToMavenLocal
2021-08-19 21:44:57 -07:00
```
4. Publish via the following command:
2021-08-19 21:44:57 -07:00
```zsh
# This uploads the file to sonotypes staging area
./gradlew publish --no-daemon --no-parallel
```
5. Deploy to maven central:
2021-08-19 21:44:57 -07:00
```zsh
# This closes the staging repository and releases it to the world
./gradlew closeAndReleaseRepository
```
Note:
Our existing artifacts can be found here and here:
https://search.maven.org/artifact/cash.z.ecc.android/zcash-android-sdk
https://repo1.maven.org/maven2/cash/z/ecc/android/