Skip to content

Commit d462822

Browse files
committed
Critical updates to make grade release process work (#218)
### What's done: - kotlinx.serialization is updated to 1.5.0 - kotlin is updated to 1.8.21 - release script is converted into the plugin (as suggested in https://kotlinlang.org/docs/multiplatform-library.html#set-up-the-environment). This is needed because new gradle became too strict and needs an explicit dependency on signing task now - Adding a hack for Gradle 8 with an explicit dependency of sign tasks on publish tasks
1 parent 76bcae0 commit d462822

File tree

13 files changed

+283
-168
lines changed

13 files changed

+283
-168
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ on:
88
env:
99
PGP_SEC: ${{ secrets.PGP_SEC }}
1010
PGP_PASSWORD: ${{ secrets.PGP_PASSWORD }}
11-
OSSRH_USERNAME: ${{ secrets.SONATYPE_USER }}
12-
OSSRH_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
11+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
12+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
1313

1414
jobs:
1515
release:
1616
name: Build release
1717
runs-on: ${{ matrix.os }}
1818
strategy:
1919
matrix:
20-
os: [ ubuntu-latest, windows-latest, macos-latest ]
20+
os: [ macos-latest ]
2121
steps:
2222
- name: Checkout
2323
uses: actions/[email protected]
@@ -37,12 +37,12 @@ jobs:
3737
- name: gradle release from tag
3838
# if workflow is triggered after push of a tag, deploy full release
3939
if: ${{ startsWith(github.ref, 'refs/tags/') }}
40-
run: ./gradlew --build-cache -Prelease publishToSonatype
41-
- name: gradle snapshot release
42-
# if workflow is triggered after push to a branch, deploy snapshot
43-
if: ${{ startsWith(github.ref, 'refs/heads/') }}
44-
run: ./gradlew --build-cache -Prelease -Preckon.stage=snapshot publishToSonatype
45-
shell: bash
40+
run: ./gradlew
41+
--console=rich
42+
-Prelease
43+
-PgprUser=${{ github.actor }}
44+
-PgprKey=${{ secrets.GITHUB_TOKEN }}
45+
publishToSonatype
4646
- name: Status git after
4747
if: ${{ always() }}
4848
run: git status

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Andrey Kuleshov
3+
Copyright (c) 2023 Andrey Kuleshov
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import com.akuleshov7.buildutils.*
33
plugins {
44
kotlin("multiplatform") apply false
55
kotlin("plugin.serialization") version Versions.KOTLIN apply false
6+
id("com.akuleshov7.buildutils.publishing-configuration")
67
}
78

89
configureVersioning()
@@ -11,6 +12,7 @@ allprojects {
1112
repositories {
1213
mavenCentral()
1314
}
15+
1416
configureDiktat()
1517
configureDetekt()
1618

@@ -22,4 +24,3 @@ allprojects {
2224
createDetektTask()
2325
installGitHooks()
2426

25-
configurePublishing()

buildSrc/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies {
1111
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21")
1212

1313
implementation("org.cqfn.diktat:diktat-gradle-plugin:1.2.5")
14-
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.15.0")
14+
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.22.0")
1515
implementation("io.github.gradle-nexus:publish-plugin:1.1.0")
1616
implementation("org.ajoberstar.reckon:reckon-gradle:0.13.0")
1717
implementation("org.ajoberstar.grgit:grgit-core:4.1.0")

buildSrc/src/main/kotlin/com/akuleshov7/Versions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"PACKAGE_NAME_INCORRECT_PATH")
55

66
object Versions {
7-
const val KOTLIN = "1.8.0"
7+
const val KOTLIN = "1.8.21"
88
const val JUNIT = "5.7.1"
99
const val OKIO = "3.1.0"
10-
const val SERIALIZATION = "1.4.1"
10+
const val SERIALIZATION = "1.5.0"
1111
}

buildSrc/src/main/kotlin/com/akuleshov7/buildutils/PublishingConfiguration.kt

Lines changed: 0 additions & 146 deletions
This file was deleted.

gradle/plugins/build.gradle.kts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
3+
plugins {
4+
`kotlin-dsl`
5+
}
6+
7+
repositories {
8+
mavenCentral()
9+
gradlePluginPortal()
10+
}
11+
12+
dependencies {
13+
implementation("io.github.gradle-nexus:publish-plugin:1.1.0")
14+
}

0 commit comments

Comments
 (0)