From a978f731ee08a5fec46437cdac0e3e96984b2a85 Mon Sep 17 00:00:00 2001 From: Wellington Costa Date: Mon, 14 Sep 2026 18:35:57 -0300 Subject: [PATCH 1/2] Fix release process --- .github/workflows/deploy.yml | 55 --------------------------- .github/workflows/release.yml | 4 +- RELEASING.md | 16 ++++++++ bugsnag-ios-link/build.gradle.kts | 10 +---- build.gradle.kts | 8 ++++ core/build.gradle.kts | 3 +- crashlytics-ios-link/build.gradle.kts | 10 +---- gradle.properties | 3 +- gradle/libs.versions.toml | 2 +- 9 files changed, 31 insertions(+), 80 deletions(-) delete mode 100644 .github/workflows/deploy.yml create mode 100644 RELEASING.md diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index ed2421e..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: deploy -on: workflow_dispatch - -jobs: -# find-release: -# runs-on: ubuntu-latest -# steps: -# - name: Checkout the repo -# uses: actions/checkout@v2 -# - name: Read version from gradle.properties -# id: read_version -# uses: christian-draeger/read-properties@1.0.1 -# with: -# path: './gradle.properties' -# property: 'VERSION_NAME' - - deploy: - runs-on: macOS-latest - steps: - - name: Checkout the repo - uses: actions/checkout@v2 - - - uses: actions/setup-java@v2 - with: - distribution: "adopt" - java-version: "17" - - - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 - - - name: Cache gradle - uses: actions/cache@v4 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} - restore-keys: | - ${{ runner.os }}-gradle- - - - name: Cache konan - uses: actions/cache@v4 - with: - path: ~/.konan - key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} - restore-keys: | - ${{ runner.os }}-gradle- - - - name: Publish - run: ./gradlew publish --no-daemon --stacktrace --no-build-cache - env: - ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} - ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} - ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} - -env: - GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c16e282..8ac2c18 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,8 +39,8 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - - name: Finish Maven Central Release - run: ./gradlew closeAndReleaseRepository --no-daemon --stacktrace --no-build-cache + - name: Publish Artifacts to Maven Central + run: ./gradlew publish --no-daemon --stacktrace --no-build-cache env: ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000..12e5f80 --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,16 @@ +# Releasing + +To be able to release, you'll need write access to the repo. + +Steps: + +1. Make sure any PRs are merged and the release is ready to be published. +2. Switch to a new release branch and `git pull` the latest. +3. Change the version in `gradle.properties`. +4. Update `CHANGELOG.md` with a summary of changes. +5. Make sure to update the lock file by running the `kotlinUpgradeYarnLock` task. +6. Push the changes with the message "Version x.y.z". +7. Open a PR to merge the release branch into `main`. +8. After the PR is merged, open `Actions` and select the `release` workflow on the left. +9. Select `Run Workflow` on the right, pick the `main` branch, and click `Run Workflow`. +10. To check status, look for the library in [https://repo1.maven.org/maven2/co/touchlab/crashkios/](https://repo1.maven.org/maven2/co/touchlab/crashkios/), find an artifact, and refresh until the version you just published shows up. diff --git a/bugsnag-ios-link/build.gradle.kts b/bugsnag-ios-link/build.gradle.kts index cda6164..8969dd6 100644 --- a/bugsnag-ios-link/build.gradle.kts +++ b/bugsnag-ios-link/build.gradle.kts @@ -14,7 +14,7 @@ plugins { `kotlin-dsl` id("java-gradle-plugin") - id("com.vanniktech.maven.publish.base") + id("com.vanniktech.maven.publish") id("com.gradle.plugin-publish") } @@ -58,11 +58,3 @@ val VERSION_NAME: String by project group = GROUP version = VERSION_NAME - -mavenPublishing { - publishToMavenCentral() - val releaseSigningEnabled = - project.properties["RELEASE_SIGNING_ENABLED"]?.toString()?.equals("false", ignoreCase = true) != true - if (releaseSigningEnabled) signAllPublications() - pomFromGradleProperties() -} diff --git a/build.gradle.kts b/build.gradle.kts index 11fd7a5..9e5b3b5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,5 @@ +import com.vanniktech.maven.publish.MavenPublishBaseExtension + plugins { alias(libs.plugins.kotlin.multiplatform) apply false alias(libs.plugins.maven.publish) apply false @@ -14,6 +16,12 @@ allprojects { } subprojects { + plugins.withId("com.vanniktech.maven.publish.base") { + configure { + publishToMavenCentral(automaticRelease = true, validateDeployment = false) + } + } + apply(plugin = "org.jlleitschuh.gradle.ktlint") configure { diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 31a5b4f..d4f7634 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -16,6 +16,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { id("com.android.library") kotlin("multiplatform") + id("com.vanniktech.maven.publish") } @Suppress("ktlint:standard:property-naming") @@ -87,5 +88,3 @@ android { .toInt() } } - -apply(plugin = "com.vanniktech.maven.publish") diff --git a/crashlytics-ios-link/build.gradle.kts b/crashlytics-ios-link/build.gradle.kts index 7b583b2..8cb28c9 100644 --- a/crashlytics-ios-link/build.gradle.kts +++ b/crashlytics-ios-link/build.gradle.kts @@ -13,7 +13,7 @@ plugins { `kotlin-dsl` id("java-gradle-plugin") - id("com.vanniktech.maven.publish.base") + id("com.vanniktech.maven.publish") id("com.gradle.plugin-publish") } @@ -57,11 +57,3 @@ val VERSION_NAME: String by project group = GROUP version = VERSION_NAME - -mavenPublishing { - publishToMavenCentral() - val releaseSigningEnabled = - project.properties["RELEASE_SIGNING_ENABLED"]?.toString()?.equals("false", ignoreCase = true) != true - if (releaseSigningEnabled) signAllPublications() - pomFromGradleProperties() -} diff --git a/gradle.properties b/gradle.properties index ca4f4e7..1af4c91 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,7 @@ org.gradle.jvmargs=-Xmx4g android.useAndroidX=true kotlin.code.style=official -#kotlin.native.home=/Users/kgalligan/temp/kotlin-native-master-hold/dist -SONATYPE_HOST=DEFAULT + RELEASE_SIGNING_ENABLED=true GROUP=co.touchlab.crashkios VERSION_NAME=0.9.0 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 631b3af..b2ec449 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,7 +7,7 @@ compileSdk = "35" # Dependencies kotlin = "2.2.21" android-gradle-plugin = "8.11.1" -mavenPublish = "0.29.0" +mavenPublish = "0.35.0" touchlab-docusaurus-template = "0.1.10" gradlePublish = "1.2.1" nsexceptionKt = "0.1.10" From efdee09f58f9c5cf76a3bc05b3d4b219d57f3256 Mon Sep 17 00:00:00 2001 From: Wellington Costa Date: Tue, 15 Sep 2026 09:55:18 -0300 Subject: [PATCH 2/2] New release process --- .github/workflows/release.yml | 58 +++++++++---------------- RELEASING.md | 80 +++++++++++++++++++++++++++++------ 2 files changed, 87 insertions(+), 51 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ac2c18..a303426 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,59 +1,43 @@ name: release -on: workflow_dispatch +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" jobs: - release: + publish: runs-on: macos-latest steps: - name: Checkout the repo - uses: actions/checkout@v2 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: touchlab/read-property@0.1 - id: version-name + - uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 with: - file: ./gradle.properties - property: VERSION_NAME - - - name: Echo Version - run: echo "${{ steps.version-name.outputs.propVal }}" - - - uses: actions/setup-java@v2 - with: - distribution: "adopt" + distribution: "temurin" java-version: "17" - - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 - - name: Cache gradle - uses: actions/cache@v4 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} - restore-keys: | - ${{ runner.os }}-gradle- - - name: Cache konan - uses: actions/cache@v4 - with: - path: ~/.konan - key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} - restore-keys: | - ${{ runner.os }}-gradle- + - name: Setup Gradle + uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 - name: Publish Artifacts to Maven Central run: ./gradlew publish --no-daemon --stacktrace --no-build-cache env: - ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} - ORG_GRADLE_PROJECT_SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} - ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.SIGNING_KEY }} ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} + release: + needs: publish + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Create Release - if: ${{ contains(steps.version-match.outputs.group1, 'SNAPSHOT') == false }} - uses: touchlab/release-action@v1.10.0 + uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 with: - tag: ${{ steps.version-name.outputs.propVal }} + generate_release_notes: true env: - GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m" + GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx4g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m" diff --git a/RELEASING.md b/RELEASING.md index 12e5f80..17e1480 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,16 +1,68 @@ # Releasing -To be able to release, you'll need write access to the repo. - -Steps: - -1. Make sure any PRs are merged and the release is ready to be published. -2. Switch to a new release branch and `git pull` the latest. -3. Change the version in `gradle.properties`. -4. Update `CHANGELOG.md` with a summary of changes. -5. Make sure to update the lock file by running the `kotlinUpgradeYarnLock` task. -6. Push the changes with the message "Version x.y.z". -7. Open a PR to merge the release branch into `main`. -8. After the PR is merged, open `Actions` and select the `release` workflow on the left. -9. Select `Run Workflow` on the right, pick the `main` branch, and click `Run Workflow`. -10. To check status, look for the library in [https://repo1.maven.org/maven2/co/touchlab/crashkios/](https://repo1.maven.org/maven2/co/touchlab/crashkios/), find an artifact, and refresh until the version you just published shows up. +CrashKiOS publishes `co.touchlab.crashkios` artifacts (`core`, `crashlytics`, `bugsnag` and the `crashlytics-ios-link` +and `bugsnag-ios-link` Gradle plugins) to Maven Central. Releases are cut by pushing a release tag. + +## Conventions + +- Tags are the bare version, no `v` prefix — `0.10.0`, not `v0.10.0`. +- The tag and `VERSION_NAME` must be identical. +- `main` sits on a `-SNAPSHOT` between releases. + +## Choosing the version + +Standard semver against the published API surface: + +- **Patch** — bug fixes, no public declarations added or changed. +- **Minor** — public declarations added. +- **Major** — public declarations removed or changed incompatibly. + +## Releasing + +Steps 1–6 are local. Nothing is published until you push the tag in step 7. + +1. **Confirm the working tree is clean and `main` is current.** +2. **Set the release version** in `gradle.properties`: + + ``` + VERSION_NAME=X.Y.Z + ``` + + Then give the `X.Y.Z` entry in `CHANGELOG.md` today's date. + +3. **Commit.** + + ```bash + git commit -am "Prepare version X.Y.Z" + ``` + +4. **Tag that commit.** + + ```bash + git tag -a X.Y.Z -m "Version X.Y.Z" + ``` + +5. **Set the next development version.** Bump the patch and re-add the suffix in + `gradle.properties`: + + ``` + VERSION_NAME=-SNAPSHOT + ``` + + So releasing `0.10.0` leaves `main` on `VERSION_NAME=0.10.1-SNAPSHOT`. + +6. **Commit.** + + ```bash + git commit -am "Prepare next development version" + ``` + +7. **Push the branch first, then the tag.** Pushing the tag triggers the `release` workflow, which publishes to Maven + Central and creates the GitHub release, so push it last: + + ```bash + git push origin main + git push origin X.Y.Z + ``` + + Pushing directly to `main` requires write access to the repo.