diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 58fbea6..70cea77 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,59 +11,17 @@ env: OSSRH_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} jobs: - release_linux: - name: Build release on main platform (Linux) + release: + name: Build and publish release runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up JDK 11 + - name: Set up JDK uses: actions/setup-java@v4 with: distribution: temurin - java-version: 11 - - uses: gradle/actions/setup-gradle@v4 - with: - gradle-version: wrapper - cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} - - run: ./gradlew publishToSonatype closeSonatypeStagingRepository - - name: Create Github Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false - release_macos: - name: Build release on MacOS - runs-on: macos-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up JDK 11 - uses: actions/setup-java@v4 - with: - distribution: zulu - java-version: 11 - - uses: gradle/actions/setup-gradle@v4 - with: - gradle-version: wrapper - cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} - - run: ./gradlew publishToSonatype closeSonatypeStagingRepository - release_windows: - name: Build release on Windows - runs-on: windows-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up JDK 11 - uses: actions/setup-java@v4 - with: - distribution: zulu - java-version: 11 + java-version: 17 - uses: gradle/actions/setup-gradle@v4 with: gradle-version: wrapper diff --git a/RELEASING.md b/RELEASING.md index 6cf0bc7..f05786f 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,3 +1,3 @@ -1. Push a new git tag of a format 'v*', e.g. v1.0.0 -2. Github Actions workflow will start, building release and pushing it to maven central. It will then create a github release. -3. Update github release with release notes. \ No newline at end of file +1. Create a Github release with a new tag in a format `vX.Y.Z`, e.g. `v0.1.2` +2. Github Actions workflow will start, building release and pushing it to maven central. +3. Staging repositories on Sonatype will be closed automatically, but need to be released manually. \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/io/github/petertrr/PublishingConfiguration.kt b/buildSrc/src/main/kotlin/io/github/petertrr/PublishingConfiguration.kt index c390f1e..5965c65 100644 --- a/buildSrc/src/main/kotlin/io/github/petertrr/PublishingConfiguration.kt +++ b/buildSrc/src/main/kotlin/io/github/petertrr/PublishingConfiguration.kt @@ -42,30 +42,6 @@ fun Project.configurePublishing() { if (hasProperty("sonatypeUsername")) { configureNexusPublishing() } - - // https://kotlinlang.org/docs/mpp-publish-lib.html#avoid-duplicate-publications - // Publication with name `kotlinMultiplatform` is for the default artifact. - // `configureNexusPublishing` adds sonatype publication tasks inside `afterEvaluate`. - rootProject.afterEvaluate { - val publicationsFromMainHost = listOf("jvm", "js", "linuxX64", "kotlinMultiplatform", "metadata") - configure { - publications.matching { it.name in publicationsFromMainHost }.all { - val targetPublication = this@all - tasks.withType() - .matching { it.publication == targetPublication } - .configureEach { - onlyIf { - // main publishing CI job is executed on Linux host - DefaultNativePlatform.getCurrentOperatingSystem().isLinux.apply { - if (!this) { - logger.lifecycle("Publication ${(it as AbstractPublishToMaven).publication.name} is skipped on current host") - } - } - } - } - } - } - } } private fun Project.configurePublications() {