Skip to content

Commit b49e48f

Browse files
committed
Fibonacci deploy 1
1 parent c1a494a commit b49e48f

File tree

4 files changed

+36
-43
lines changed

4 files changed

+36
-43
lines changed

.github/workflows/deploy.yml

Lines changed: 28 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# This workflow uses actions that are not certified by GitHub.
2-
# They are provided by a third-party and are governed by
3-
# separate terms of service, privacy policy, and support
4-
# documentation.
5-
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
7-
8-
name: Deploy to central
1+
name: Publish Artifacts
92

103
on: workflow_dispatch
114

125
permissions:
136
contents: read
147

8+
env:
9+
ORG_GRADLE_PROJECT_mavenCentralUsername: '${{ secrets.MAVEN_CENTRAL_USERNAME }}'
10+
ORG_GRADLE_PROJECT_mavenCentralPassword: '${{ secrets.MAVEN_CENTRAL_PASSWORD }}'
11+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: '${{ secrets.SIGNING_KEY_ID }}'
12+
ORG_GRADLE_PROJECT_signingInMemoryKey: '${{ secrets.SIGNING_KEY }}'
13+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: '${{ secrets.SIGNING_KEY_PASSWORD }}'
14+
1515
jobs:
1616
build:
1717
uses: ./.github/workflows/gradle.yml
@@ -20,39 +20,30 @@ jobs:
2020
strategy:
2121
matrix:
2222
include:
23-
- target: publishIosArm64PublicationToSonatypeRepository
23+
- target: publishIosArm64PublicationToMavenCentral
2424
os: macos-latest
25-
- target: publishAndroidReleasePublicationToSonatypeRepository
25+
- target: publishAndroidReleasePublicationToMavenCentral
2626
os: ubuntu-latest
27-
- target: publishJvmPublicationToSonatypeRepository
27+
- target: publishJvmPublicationToMavenCentral
2828
os: ubuntu-latest
29-
- target: publishLinuxX64PublicationToSonatypeRepository
29+
- target: publishLinuxX64PublicationToMavenCentral
3030
os: ubuntu-latest
31-
- target: publishKotlinMultiplatformPublicationToSonatypeRepository
31+
- target: publishKotlinMultiplatformPublicationToMavenCentral
3232
os: ubuntu-latest
3333
runs-on: ${{ matrix.os }}
3434
steps:
35-
- uses: actions/checkout@v4
36-
- name: Validate Gradle Wrapper
37-
uses: gradle/wrapper-validation-action@v1
38-
- name: Import GPG key
39-
uses: crazy-max/ghaction-import-gpg@v6
40-
with:
41-
gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
42-
passphrase: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
43-
- name: Set up JDK 17
44-
uses: actions/setup-java@v4
45-
with:
46-
java-version: '17'
47-
distribution: 'temurin'
48-
- name: Gradle publish
49-
uses: gradle/gradle-build-action@ce999babab2de1c4b649dc15f0ee67e6246c994f
50-
with:
51-
arguments: |
52-
${{ matrix.target }}
53-
closeSonatypeStagingRepository
54-
-Psigning.gnupg.passphrase='${{secrets.OSSRH_GPG_SECRET_KEY_PASSWORD}}'
55-
-Psigning.gnupg.keyName='${{secrets.OSSRH_GPG_SECRET_KEY_ID}}'
56-
-PsonatypeUsername='${{secrets.OSSRH_USERNAME}}'
57-
-PsonatypePassword='${{secrets.OSSRH_PASSWORD}}'
58-
35+
- uses: actions/checkout@v3
36+
- name: Validate Gradle Wrapper
37+
uses: gradle/wrapper-validation-action@v1
38+
- uses: actions/cache@v3
39+
with:
40+
path: |
41+
~/.konan
42+
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
43+
- name: Set up JDK 17
44+
uses: actions/setup-java@v3
45+
with:
46+
java-version: '17'
47+
distribution: 'temurin'
48+
- name: Publish to Maven Central
49+
run: ./gradlew publish --no-configuration-cache

.github/workflows/gradle.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ jobs:
3535
runs-on: ${{ matrix.os }}
3636

3737
steps:
38-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v3
3939
- name: Validate Gradle Wrapper
40-
uses: gradle/actions/wrapper-validation@v3
41-
- uses: actions/cache@v4
40+
uses: gradle/wrapper-validation-action@v1
41+
- uses: actions/cache@v3
4242
with:
4343
path: |
4444
~/.konan
4545
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
4646
- name: Set up JDK 17
47-
uses: actions/setup-java@v4
47+
uses: actions/setup-java@v3
4848
with:
4949
java-version: '17'
5050
distribution: 'temurin'

fibonacci/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import com.vanniktech.maven.publish.SonatypeHost
12
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
23
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
34

@@ -7,7 +8,7 @@ version = "1.0.3"
78
plugins {
89
alias(libs.plugins.kotlinMultiplatform)
910
alias(libs.plugins.androidLibrary)
10-
id("module.publication")
11+
alias(libs.plugins.publish)
1112
}
1213

1314
kotlin {

gradle/libs.versions.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ nexus-publish = { module = "io.github.gradle-nexus.publish-plugin:io.github.grad
1111

1212
[plugins]
1313
androidLibrary = { id = "com.android.library", version.ref = "agp" }
14-
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
14+
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
15+
publish = { id = "com.vanniktech.maven.publish", version = "0.29.0" }

0 commit comments

Comments
 (0)