Skip to content
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
55 changes: 0 additions & 55 deletions .github/workflows/deploy.yml

This file was deleted.

62 changes: 23 additions & 39 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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: 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 }}
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"
68 changes: 68 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Releasing

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=<next patch>-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.
10 changes: 1 addition & 9 deletions bugsnag-ios-link/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down Expand Up @@ -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()
}
8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -14,6 +16,12 @@ allprojects {
}

subprojects {
plugins.withId("com.vanniktech.maven.publish.base") {
configure<MavenPublishBaseExtension> {
publishToMavenCentral(automaticRelease = true, validateDeployment = false)
}
}

apply(plugin = "org.jlleitschuh.gradle.ktlint")

configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
Expand Down
3 changes: 1 addition & 2 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -87,5 +88,3 @@ android {
.toInt()
}
}

apply(plugin = "com.vanniktech.maven.publish")
10 changes: 1 addition & 9 deletions crashlytics-ios-link/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down Expand Up @@ -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()
}
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading