Skip to content

Commit 951cddf

Browse files
authored
Merge pull request #16 from reduxkotlin/feature/github-actions
Add GitHub actions for test & publish
2 parents 1dc8db3 + 34a2d3e commit 951cddf

File tree

14 files changed

+120
-15
lines changed

14 files changed

+120
-15
lines changed

.github/workflows/publish_release.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish a release
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
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish snapshot
2+
3+
on:
4+
push:
5+
branches: [ master, feature/* ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
publish-snapshot:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [macos-latest, windows-latest, ubuntu-latest]
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Publish macOS artifacts Snapshot
20+
id: publish-macos
21+
if: matrix.os == 'macos-latest'
22+
env:
23+
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
24+
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
25+
GPG_SECRET: ${{ secrets.GPG_SECRET }}
26+
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
27+
SNAPSHOT: 'TRUE'
28+
run: ./gradlew publish
29+
30+
- name: Publish windows artifacts Snapshot
31+
id: publish-win
32+
if: matrix.os == 'windows-latest'
33+
env:
34+
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
35+
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
36+
GPG_SECRET: ${{ secrets.GPG_SECRET }}
37+
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
38+
SNAPSHOT: 'TRUE'
39+
run: ./gradlew publish
40+
41+
- name: Publish linux artifacts Snapshot
42+
id: publish-linux
43+
if: matrix.os == 'ubuntu-latest'
44+
env:
45+
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
46+
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
47+
GPG_SECRET: ${{ secrets.GPG_SECRET }}
48+
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
49+
SNAPSHOT: 'TRUE'
50+
run: ./gradlew publish

.github/workflows/test.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- 'docs/**'
7+
- '*.md'
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 redux-kotlin Test Reports
19+
uses: actions/upload-artifact@v1
20+
with:
21+
name: redux-kotlin_test_reports
22+
path: redux-kotlin/build/reports/tests
23+
24+
- name: Archive redux-kotlin-threadsafe Test Reports
25+
uses: actions/upload-artifact@v1
26+
with:
27+
name: redux-kotlin-threadsafe_test_reports
28+
path: redux-kotlin-threadsafe/build/reports/tests

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ kotlin {
5151
sourceSets {
5252
commonMain { // <--- name may vary on your project
5353
dependencies {
54-
implementation "org.reduxkotlin:redux-kotlin-thunk:0.4.0"
54+
implementation "org.reduxkotlin:redux-kotlin-thunk:0.5.3"
5555
}
5656
}
5757
}
5858
```
5959

6060
For JVM only:
6161
```
62-
implementation "org.reduxkotlin:redux-kotlin-jvm-thunk:0.4.0"
62+
implementation "org.reduxkotlin:redux-kotlin-jvm-thunk:0.5.3"
6363
```
6464

6565
[badge-android]: http://img.shields.io/badge/platform-android-brightgreen.svg?style=flat

build.gradle

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ allprojects {
2828

2929
group = GROUP
3030
version = VERSION_NAME
31+
if (hasProperty("SNAPSHOT") || System.getenv("SNAPSHOT") != null) {
32+
version = version + "-SNAPSHOT"
33+
}
3134
}
3235

3336
task clean(type: Delete) {

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ kotlin.code.style=official
2222
org.gradle.internal.publish.checksums.insecure=true
2323

2424
GROUP=org.reduxkotlin
25-
VERSION_NAME=0.4.0
25+
VERSION_NAME=0.5.3
2626

2727
POM_ARTIFACT_ID=reduxkotlin-thunk
2828
POM_DESCRIPTION=Redux thunmk implementation for Redux-Kotlin. Mulitiplatform supported.

gradle/dependencies.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
ext.versions = [
2-
kotlin : '1.3.70',
2+
kotlin : '1.3.72',
33
dokka : '0.9.17',
44
spek : '2.1.0-alpha.0.9+3d5d865',
55
atrium : '0.8.0',
6-
redux : '0.4.0'
6+
redux : '0.5.3'
77
]
88

99
ext.deps = [

gradle/publish.gradle

+7-4
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) {
@@ -75,7 +75,10 @@ task javadocsJar(type: Jar, dependsOn: dokka) {
7575
}
7676

7777
signing {
78-
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
78+
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
File renamed without changes.

lib/build.gradle renamed to redux-kotlin-thunk/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ apply plugin: 'kotlin-multiplatform'
77
archivesBaseName = 'redux-kotlin-thunk'
88

99
group 'org.reduxkotlin'
10-
version '0.4.0'
10+
version '0.5.3'
1111

1212
kotlin {
1313
jvm()
File renamed without changes.

settings.gradle

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ pluginManagement {
88
}
99
}
1010

11-
include ':lib'
11+
include ':redux-kotlin-thunk'
1212
rootProject.name='Redux-Kotlin-thunk'
1313

14-
15-
rootProject.name = 'test'
1614
enableFeaturePreview('GRADLE_METADATA')
17-

0 commit comments

Comments
 (0)