Skip to content

Latest commit

 

History

History
250 lines (206 loc) · 6.49 KB

RELEASING.md

File metadata and controls

250 lines (206 loc) · 6.49 KB

Releasing

Linux

  • Ensure java version is greater than or equal to 17 (required for Android)
java --version
  • Set version variable in terminal shell
VERSION_NAME="<version name>"
  • Create a release branch
git checkout master
git pull
git checkout -b release_"$VERSION_NAME"
  • Update :build-environment src/main/kotlin/kmp/tor/env version constants

    • Remove -SNAPSHOT
    • Bump MANAGER_VERSION_NAME and MANAGER_VERSION_CODE
    • Bump BINARY_VERSION_NAME and BINARY_VERSION_CODE
    • If it is a tor binary version update only:
      • Set env.kmpTorAll.isBinaryRelease to true
      • Ensure SNAPSHOT is empty (i.e. "")
      • Set MANAGER_VERSION_NAME and MANAGER_VERSION_CODE to last published versions so that the :kmp-tor module will depend on those artifacts when being built and published.
      • This will only publish the kmp-tor module.
  • Update version in project's README.md documentation

  • Update CHANGELOG.md

  • Commit Changes

git add --all
git commit -S -m "Prepare $VERSION_NAME release"
git tag -s "$VERSION_NAME" -m "Release v$VERSION_NAME"
  • Make sure you have valid credentials in ~/.gradle/gradle.properties
mavenCentralUsername=MyUserName
mavenCentralPassword=MyPassword
  • Make sure you have GPG gradle config setup in ~/.gradle/gradle.properties for signing
signing.gnupg.executable=gpg
signing.gnupg.useLegacyGpg=true
signing.gnupg.homeDir=/path/to/.gnupg/
signing.gnupg.optionsFile=/path/to/.gnupg/gpg.conf
signing.gnupg.keyName=0x61471B8AB3890961
  • Make sure GPG is picking up YubiKey to sign releases
gpg --card-status
  • Disable YubiKey touch for signing
ykman openpgp keys set-touch sig off
  • Perform a clean build
./gradlew clean -DKMP_TARGETS_ALL
./gradlew build -DKMP_TARGETS_ALL
  • Publish
./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel -DKMP_TARGETS_ALL
  • Push release branch to repo (to publish from macOS)
git push -u origin release_"$VERSION_NAME"

Macos

  • Spin up VM of macOS and ensure USB pass through worked for the YubiKey

    • Should ask for PIN to log in
  • Sign a random .txt file (gpg tty for YubiKey PIN + gradle build don't mix)

gpg --sign --armor --detach ~/Documents/hello.txt
  • Ensure java version is greater than or equal to 11
java --version
  • Ensure you are in a bash shell
bash
  • Set version variable in terminal shell
VERSION_NAME="<version name>"
  • Pull the latest code from release branch
git checkout master
git pull
git checkout release_"$VERSION_NAME"
  • Make sure you have valid credentials in ~/.gradle/gradle.properties
mavenCentralUsername=MyUserName
mavenCentralPassword=MyPassword
  • Make sure you have GPG gradle config setup in ~/.gradle/gradle.properties for signing
signing.gnupg.executable=gpg
signing.gnupg.useLegacyGpg=true
signing.gnupg.homeDir=/path/to/.gnupg/
signing.gnupg.optionsFile=/path/to/.gnupg/gpg.conf
signing.gnupg.keyName=0x61471B8AB3890961
  • Perform a clean build
MACOS_TARGETS="JVM,JS,IOS_ARM32,IOS_ARM64,IOS_X64,IOS_SIMULATOR_ARM64,MACOS_ARM64,MACOS_X64,TVOS_ARM64,TVOS_X64,TVOS_SIMULATOR_ARM64,WATCHOS_ARM32,WATCHOS_ARM64,WATCHOS_DEVICE_ARM64,WATCHOS_X64,WATCHOS_X86,WATCHOS_SIMULATOR_ARM64,WASM,WASM_32"
./gradlew clean -PKMP_TARGETS="$MACOS_TARGETS"
./gradlew build -PKMP_TARGETS="$MACOS_TARGETS"
  • Publish macOS build
PUBLISH_TASKS=$(./gradlew tasks -PKMP_TARGETS="$MACOS_TARGETS" |
  grep "ToMavenCentralRepository" |
  cut -d ' ' -f 1 |
  grep -e "publishIos" -e "publishMacos" -e "publishTvos" -e "publishWatchos"
)
./gradlew $PUBLISH_TASKS --no-daemon --no-parallel -PKMP_TARGETS="$MACOS_TARGETS"

Linux

  • Check Publication
./gradlew clean -PCHECK_PUBLICATION -DKMP_TARGETS_ALL
./gradlew :tools:check-publication:build --refresh-dependencies -PCHECK_PUBLICATION -DKMP_TARGETS_ALL
  • Re-enable YubiKey touch for signing
ykman openpgp keys set-touch sig on
  • The gradle-maven-publish-plugin should have automatically closed the staged repositories, but if it did not:

    • Close publications (Don't release yet)
      • Login to Sonatype OSS Nexus: oss.sonatype.org
      • Click on Staging Repositories
      • Select all Publications
      • Click Close then Confirm
      • Wait a bit, hit Refresh until the Status changes to Closed
  • Release publications from Sonatype OSS Nexus StagingRepositories manager

    • Alternatively, can use Curl with the given repository id's that were output to terminal when publishing, e.g. iomatthewnelson-1018
      curl -v -u "<USER NAME>" \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        https://s01.oss.sonatype.org/service/local/staging/bulk/promote --data '
        {
          "data": {
            "stagedRepositoryIds": [
              "<repository id>",
              "<repository id>"
            ],
            "autoDropAfterRelease": true
          }
        }'
  • Merge release branch to master

git checkout master
git pull
git merge --no-ff -S release_"$VERSION_NAME"
  • Update :build-environment src/main/kotlin/kmp/tor/env version constants

    • Re-add -SNAPSHOT
    • Bump MANAGER_VERSION_NAME and MANAGER_VERSION_CODE
    • If it was a tor binary version update only:
      • Set env.kmpTorAll.isBinaryRelease back to false
  • Update gradle/libs.versions.toml for javafx sample app

    • [versions].kmpTorBinary
    • [versions].kmpTor
  • Commit changes

git add --all
git commit -S -m "Prepare for next development iteration"
  • Push Changes
git push
  • Push Tag
git push origin "$VERSION_NAME"
  • Delete release branch on GitHub

  • Delete local release branch

git branch -D release_"$VERSION_NAME"

Macos

  • Checkout master
git checkout master
git pull
  • Delete local release branch
git branch -D release_"$VERSION_NAME"
  • Shutdown VMs (if not needed anymore)

Linux

  • Wait for releases to become available on MavenCentral
  • Draft new release on GitHub
    • Enter the release name as tag and title
    • Have the description point to the changelog