Skip to content

Commit

Permalink
Merge pull request #58 from reduxkotlin/feature/test-snapshot
Browse files Browse the repository at this point in the history
fix CI publishing
  • Loading branch information
patjackson52 authored Jul 6, 2020
2 parents 8cfdafd + 64d458b commit 95607a6
Show file tree
Hide file tree
Showing 33 changed files with 91 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Publish a release

on:
push:
Expand Down
65 changes: 41 additions & 24 deletions .github/workflows/publish_snapshot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Publish snapshot

on:
push:
Expand All @@ -7,41 +7,58 @@ on:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Test
run: ./gradlew jvmTest

- name: Archive lib Test Reports
uses: actions/upload-artifact@v1
with:
name: lib_test_reports
path: lib/build/reports/tests

- name: Archive lib-threadsafe Test Reports
uses: actions/upload-artifact@v1
with:
name: lib_test_reports
path: lib/build/reports/tests

publish-snapshot:
needs: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [macos-latest, windows-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v2

- name: Publish Snapshot
- name: Publish macOS artifacts Snapshot
id: publish-macos
if: matrix.os == 'macos-latest'
env:
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
SNAPSHOT: 'TRUE'
run: ./gradlew publish

- name: Publish windows artifacts Snapshot
id: publish-win
if: matrix.os == 'windows-latest'
env:
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
SNAPSHOT: 'TRUE'
run: ./gradlew publish

- name: Publish linux artifacts Snapshot
id: publish-linux
if: matrix.os == 'ubuntu-latest'
env:
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
SNAPSHOT: 'TRUE'
run: ./gradlew publish

- name: Archive lib publications dir
uses: actions/upload-artifact@v1
with:
name: publications-${{ matrix.os }}
path: redux-kotlin/build/publications

- name: Archive lib-threadsafe publications dir
if: steps.publish-win.outputs.exit_code == 0 || steps.publish-macos.outputs.exit_code == 0 || steps.publish-linux.outputs.exit_code == 0
uses: actions/upload-artifact@v1
with:
name: publications-threadsafe-${{ matrix.os }}
path: redux-kotlin-threadsafe/build/publications

28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test

on:
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Test
run: ./gradlew jvmTest

- name: Archive redux-kotlin Test Reports
uses: actions/upload-artifact@v1
with:
name: redux-kotlin_test_reports
path: redux-kotlin/build/reports/tests

- name: Archive redux-kotlin-threadsafe Test Reports
uses: actions/upload-artifact@v1
with:
name: redux-kotlin-threadsafe_test_reports
path: redux-kotlin-threadsafe/build/reports/tests
2 changes: 1 addition & 1 deletion examples/counter/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ dependencies {
implementation(Libs.appcompat)

implementation(project(":examples:counter:common"))
implementation(project(":lib-threadsafe"))
implementation(project(":redux-kotlin-threadsafe"))
}
2 changes: 1 addition & 1 deletion examples/counter/common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ kotlin {
commonMain {
dependencies {
implementation kotlin("stdlib-common")
implementation project(":lib")
implementation project(":redux-kotlin")
}
}
commonTest {
Expand Down
2 changes: 1 addition & 1 deletion examples/todos/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ dependencies {
implementation(Libs.recyclerView)

implementation(project(":examples:todos:common"))
implementation(project(":lib-threadsafe"))
implementation(project(":redux-kotlin-threadsafe"))
}
2 changes: 1 addition & 1 deletion examples/todos/common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ kotlin {
commonMain {
dependencies {
implementation kotlin("stdlib-common")
implementation project(":lib-threadsafe")
implementation project(":redux-kotlin-threadsafe")
}
}
commonTest {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official

GROUP=org.reduxkotlin.redux-kotlin
VERSION_NAME=0.5.2
GROUP=org.reduxkotlin
VERSION_NAME=0.5.3

POM_ARTIFACT_ID=reduxkotlin
POM_DESCRIPTION=Redux implementation for Kotlin. Mulitiplatform supported.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ kotlin {
commonMain {
dependencies {
implementation kotlin("stdlib-common")
api project(":lib")
api project(":redux-kotlin")
}
}
commonTest {
Expand Down Expand Up @@ -118,6 +118,12 @@ afterEvaluate {

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

publishing {
publications.all {
artifactId = artifactId.replace(project.name, 'redux-kotlin-threadsafe')
}
}

jvmTest {
useJUnitPlatform {
includeEngines 'spek2'
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions lib/build.gradle → redux-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ afterEvaluate {

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

publishing {
publications.all {
artifactId = artifactId.replace(project.name, 'redux-kotlin')
}
}

jvmTest {
useJUnitPlatform {
includeEngines 'spek2'
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ pluginManagement {
}

include(
':lib',
':lib-threadsafe',
':redux-kotlin',
':redux-kotlin-threadsafe',
':examples:counter:common',
':examples:counter:android',
':examples:todos:common',
Expand Down

0 comments on commit 95607a6

Please sign in to comment.