Skip to content

Commit f1e8543

Browse files
committed
test github actions deploy to maven
1 parent 3110d6e commit f1e8543

File tree

8 files changed

+91
-168
lines changed

8 files changed

+91
-168
lines changed

.circleci/config.yml

Lines changed: 0 additions & 103 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, macos-latest, windows-latest]
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Publish Release
19+
env:
20+
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
21+
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
22+
GPG_SECRET: ${{ secrets.GPG_SECRET }}
23+
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
24+
run: ./gradlew publish
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, feature/* ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Test
16+
run: ./gradlew jvmTest
17+
18+
- name: Archive lib Test Reports
19+
uses: actions/upload-artifact@v1
20+
with:
21+
name: lib_test_reports
22+
path: lib/build/reports/tests
23+
24+
- name: Archive lib-threadsafe Test Reports
25+
uses: actions/upload-artifact@v1
26+
with:
27+
name: lib_test_reports
28+
path: lib/build/reports/tests
29+
30+
publish-snapshot:
31+
needs: test
32+
runs-on: ${{ matrix.os }}
33+
strategy:
34+
matrix:
35+
os: [ubuntu-latest, macos-latest, windows-latest]
36+
37+
steps:
38+
- uses: actions/checkout@v2
39+
40+
- name: Publish Snapshot
41+
env:
42+
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
43+
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
44+
GPG_SECRET: ${{ secrets.GPG_SECRET }}
45+
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
46+
run: ./gradlew publishSnapShot

.github/workflows/test.yml

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

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ android.enableJetifier=true
2121
kotlin.code.style=official
2222

2323
GROUP=org.reduxkotlin.redux-kotlin
24-
VERSION_NAME=0.5.1
24+
VERSION_NAME=0.5.2
2525

2626
POM_ARTIFACT_ID=reduxkotlin
2727
POM_DESCRIPTION=Redux implementation for Kotlin. Mulitiplatform supported.

gradle/publish.gradle

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ dokka {
4444
}
4545

4646
def isReleaseBuild() {
47-
return VERSION_NAME.contains("SNAPSHOT") == false
47+
return version.contains("SNAPSHOT") == false
4848
}
4949

5050
def getReleaseRepositoryUrl() {
@@ -58,11 +58,11 @@ def getSnapshotRepositoryUrl() {
5858
}
5959

6060
def getRepositoryUsername() {
61-
return hasProperty('SONATYPE_NEXUS_USERNAME') ? SONATYPE_NEXUS_USERNAME : ""
61+
return findProperty('SONATYPE_NEXUS_USERNAME') ?: System.getenv('SONATYPE_NEXUS_USERNAME') ?: ""
6262
}
6363

6464
def getRepositoryPassword() {
65-
return hasProperty('SONATYPE_NEXUS_PASSWORD') ? SONATYPE_NEXUS_PASSWORD : ""
65+
return findProperty('SONATYPE_NEXUS_PASSWORD') ?: System.getenv('SONATYPE_NEXUS_PASSWORD') ?: ""
6666
}
6767

6868
task emptySourcesJar(type: Jar) {
@@ -76,6 +76,9 @@ task javadocsJar(type: Jar, dependsOn: dokka) {
7676

7777
signing {
7878
required { isReleaseBuild() /*&& gradle.taskGraph.hasTask("uploadArchives") */ }
79+
def signingKey = findProperty("GPG_SECRET") ?: System.getenv('GPG_SECRET') ?: ""
80+
def signingPassword = findProperty("GPG_SIGNING_PASSWORD") ?: System.getenv('GPG_SIGNING_PASSWORD') ?: ""
81+
useInMemoryPgpKeys(signingKey, signingPassword)
7982
sign(publishing.publications)
8083
}
8184

lib-threadsafe/build.gradle

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ apply plugin: 'kotlinx-atomicfu'
77

88
archivesBaseName = 'redux-kotlin-threadsafe'
99

10-
group 'org.reduxkotlin'
11-
version '0.5.1'
12-
1310
kotlin {
1411
jvm()
1512
js() {
@@ -29,8 +26,8 @@ kotlin {
2926
//below are currently not supported by atomicfu
3027
//wasm32("wasm")
3128
//linuxArm32Hfp("linArm32")
32-
linuxMips32("linMips32")
33-
linuxMipsel32("linMipsel32")
29+
//linuxMips32("linMips32")
30+
//linuxMipsel32("linMipsel32")
3431
linuxX64("lin64")
3532

3633
sourceSets {
@@ -119,17 +116,16 @@ afterEvaluate {
119116
//tasks.create('uploadArchives').dependsOn('publishKotlinMultiplatformPublicationToMavenRepository')
120117
}
121118

122-
apply from: rootProject.file('gradle/publish.gradle')
123-
124-
publishing {
125-
publications.all {
126-
// Rewrite all artifacts from using the project name to just 'runtime'.
127-
artifactId = artifactId.replace(project.name, 'redux-kotlin-threadsafe')
128-
}
119+
task publishSnapshot {
120+
version = version + '-SNAPSHOT'
129121
}
130122

123+
apply from: rootProject.file('gradle/publish.gradle')
124+
131125
jvmTest {
132126
useJUnitPlatform {
133127
includeEngines 'spek2'
134128
}
135129
}
130+
131+
publishSnapshot.finalizedBy publish

lib/build.gradle

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ apply plugin: 'kotlin-multiplatform'
66

77
archivesBaseName = 'redux-kotlin'
88

9-
group 'org.reduxkotlin'
10-
version '0.5.1'
11-
129
kotlin {
1310
jvm()
1411
js() {
@@ -134,17 +131,17 @@ afterEvaluate {
134131
//tasks.create('uploadArchives').dependsOn('publishKotlinMultiplatformPublicationToMavenRepository')
135132
}
136133

137-
apply from: rootProject.file('gradle/publish.gradle')
138134

139-
publishing {
140-
publications.all {
141-
// Rewrite all artifacts from using the project name to just 'runtime'.
142-
artifactId = artifactId.replace(project.name, 'redux-kotlin')
143-
}
135+
task publishSnapshot {
136+
version = version + '-SNAPSHOT'
144137
}
145138

139+
apply from: rootProject.file('gradle/publish.gradle')
140+
146141
jvmTest {
147142
useJUnitPlatform {
148143
includeEngines 'spek2'
149144
}
150145
}
146+
147+
publishSnapshot.finalizedBy publish

0 commit comments

Comments
 (0)