publish.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. #
  3. # Modern Central Portal Publishing Setup:
  4. # 1. Set up PGP key for signing: gpg --generate-key
  5. # 2. Create Central Portal account at https://central.sonatype.com/
  6. # 3. Generate user token in Central Portal settings
  7. # 4. Create ~/.gradle/gradle.properties with:
  8. # MAVEN_USERNAME=<central-portal-username>
  9. # MAVEN_PASSWORD=<central-portal-token>
  10. # signing.gnupg.passphrase=<pgp-key-passphrase>
  11. #
  12. # Version Configuration:
  13. # - Edit spine-libgdx/gradle.properties and update the 'version' property. YES, THIS IS THE SINGLE SOURCE OF TRUTH.
  14. # - For releases: version=4.2.9 (no -SNAPSHOT suffix)
  15. # - For snapshots: version=4.2.9-SNAPSHOT (with -SNAPSHOT suffix)
  16. #
  17. # Usage: ./publish.sh
  18. # The script automatically detects snapshot vs release based on version in gradle.properties
  19. #
  20. set -e
  21. # Read version from spine-libgdx gradle.properties (single source of truth)
  22. VERSION=$(grep '^version=' ../spine-libgdx/gradle.properties | cut -d'=' -f2)
  23. if echo "$VERSION" | grep -q "SNAPSHOT"; then
  24. echo "Publishing SNAPSHOT version $VERSION to Central Portal..."
  25. ./gradlew :spine-android:publishReleasePublicationToSonaTypeRepository --info
  26. else
  27. echo "Publishing RELEASE version $VERSION to Central Portal via JReleaser..."
  28. ./gradlew :spine-android:publishReleasePublicationToSonaTypeRepository -PRELEASE
  29. ./gradlew :spine-android:jreleaserDeploy -PRELEASE --info
  30. fi