Skip to content

Commit

Permalink
Critical updates to make grade release process work (#218)
Browse files Browse the repository at this point in the history
### 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
  • Loading branch information
orchestr7 committed May 10, 2023
1 parent 76bcae0 commit d462822
Show file tree
Hide file tree
Showing 13 changed files with 283 additions and 168 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ on:
env:
PGP_SEC: ${{ secrets.PGP_SEC }}
PGP_PASSWORD: ${{ secrets.PGP_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.SONATYPE_USER }}
OSSRH_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

jobs:
release:
name: Build release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
os: [ macos-latest ]
steps:
- name: Checkout
uses: actions/checkout@v2.7.0
Expand All @@ -37,12 +37,12 @@ jobs:
- name: gradle release from tag
# if workflow is triggered after push of a tag, deploy full release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: ./gradlew --build-cache -Prelease publishToSonatype
- name: gradle snapshot release
# if workflow is triggered after push to a branch, deploy snapshot
if: ${{ startsWith(github.ref, 'refs/heads/') }}
run: ./gradlew --build-cache -Prelease -Preckon.stage=snapshot publishToSonatype
shell: bash
run: ./gradlew
--console=rich
-Prelease
-PgprUser=${{ github.actor }}
-PgprKey=${{ secrets.GITHUB_TOKEN }}
publishToSonatype
- name: Status git after
if: ${{ always() }}
run: git status
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Andrey Kuleshov
Copyright (c) 2023 Andrey Kuleshov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import com.akuleshov7.buildutils.*
plugins {
kotlin("multiplatform") apply false
kotlin("plugin.serialization") version Versions.KOTLIN apply false
id("com.akuleshov7.buildutils.publishing-configuration")
}

configureVersioning()
Expand All @@ -11,6 +12,7 @@ allprojects {
repositories {
mavenCentral()
}

configureDiktat()
configureDetekt()

Expand All @@ -22,4 +24,3 @@ allprojects {
createDetektTask()
installGitHooks()

configurePublishing()
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21")

implementation("org.cqfn.diktat:diktat-gradle-plugin:1.2.5")
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.15.0")
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.22.0")
implementation("io.github.gradle-nexus:publish-plugin:1.1.0")
implementation("org.ajoberstar.reckon:reckon-gradle:0.13.0")
implementation("org.ajoberstar.grgit:grgit-core:4.1.0")
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/com/akuleshov7/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"PACKAGE_NAME_INCORRECT_PATH")

object Versions {
const val KOTLIN = "1.8.0"
const val KOTLIN = "1.8.21"
const val JUNIT = "5.7.1"
const val OKIO = "3.1.0"
const val SERIALIZATION = "1.4.1"
const val SERIALIZATION = "1.5.0"
}

This file was deleted.

14 changes: 14 additions & 0 deletions gradle/plugins/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
gradlePluginPortal()
}

dependencies {
implementation("io.github.gradle-nexus:publish-plugin:1.1.0")
}
Loading

0 comments on commit d462822

Please sign in to comment.