Skip to content

Commit

Permalink
Merge pull request #972 from square/rick/split_up_publish_snapshot_wo…
Browse files Browse the repository at this point in the history
…rkflow
  • Loading branch information
RBusarow authored Mar 20, 2023
2 parents 321ad71 + 9459cfb commit 93f4bac
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 17 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on :
# Don't build the entire app when just changing tutorials, which have their own workflow.
- 'samples/tutorial/**'

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx5g -Dorg.gradle.daemon=false -Dorg.gradle.logging.stacktrace=all"

jobs :

cancel-stale-jobs :
Expand Down Expand Up @@ -41,7 +44,7 @@ jobs :
name : Assemble with gradle — make sure everything builds
with :
arguments : |
assemble --stacktrace
assemble
cache-read-only: false

# This should ideally be done as a Check job below, but it needs to be done as a separate
Expand All @@ -52,7 +55,7 @@ jobs :
name : Run dokka to validate kdoc
with :
arguments : |
siteDokka --build-cache --stacktrace
siteDokka --build-cache
cache-read-only: false

# the `artifactsCheck` task has to run on macOS in order to see the iOS KMP artifacts
Expand Down Expand Up @@ -132,7 +135,7 @@ jobs :
name : Check with Gradle
with :
arguments : |
allTests test apiCheck checkVersionIsSnapshot lint lintKotlin jvmWorkflowNodeBenchmarkJar --stacktrace --continue
allTests test apiCheck checkVersionIsSnapshot lint lintKotlin jvmWorkflowNodeBenchmarkJar --continue
cache-read-only: false

# Report as Github Pull Request Check.
Expand Down Expand Up @@ -160,7 +163,7 @@ jobs :
name : Check with Gradle
with :
arguments : |
jvmTest --stacktrace --continue -Pworkflow.runtime=conflate
jvmTest --continue -Pworkflow.runtime=conflate
cache-read-only : false

# Report as Github Pull Request Check.
Expand Down Expand Up @@ -188,7 +191,7 @@ jobs :
name : Check with Gradle
with :
arguments : |
iosX64Test --stacktrace
iosX64Test
cache-read-only: false

# Report as Github Pull Request Check.
Expand Down Expand Up @@ -216,7 +219,7 @@ jobs :
name : Check with Gradle
with :
arguments : |
jsTest --stacktrace
jsTest
cache-read-only : false

# Report as Github Pull Request Check.
Expand Down Expand Up @@ -251,7 +254,7 @@ jobs :
name : Build instrumented tests
with :
arguments : |
:benchmarks:performance-poetry:complex-poetry:assembleDebugAndroidTest --stacktrace
:benchmarks:performance-poetry:complex-poetry:assembleDebugAndroidTest
cache-read-only: false

## Actual task
Expand All @@ -263,7 +266,7 @@ jobs :
api-level : ${{ matrix.api-level }}
arch : x86_64
# Skip the benchmarks as this is running on emulators
script : ./gradlew :benchmarks:performance-poetry:complex-poetry:connectedCheck --stacktrace --continue
script : ./gradlew :benchmarks:performance-poetry:complex-poetry:connectedCheck --continue

- name : Upload results
if : ${{ always() }}
Expand Down Expand Up @@ -297,7 +300,7 @@ jobs :
name : Build instrumented tests
with :
arguments : |
assembleDebugAndroidTest --stacktrace
assembleDebugAndroidTest
cache-read-only: false

## Actual task
Expand All @@ -309,7 +312,7 @@ jobs :
api-level : ${{ matrix.api-level }}
arch : x86_64
# Skip the benchmarks as this is running on emulators
script : ./gradlew connectedCheck -x :benchmarks:dungeon-benchmark:connectedCheck -x :benchmarks:performance-poetry:complex-benchmark:connectedCheck -x :benchmarks:performance-poetry:complex-poetry:connectedCheck --stacktrace
script : ./gradlew connectedCheck -x :benchmarks:dungeon-benchmark:connectedCheck -x :benchmarks:performance-poetry:complex-benchmark:connectedCheck -x :benchmarks:performance-poetry:complex-poetry:connectedCheck

- name : Upload results
if : ${{ always() }}
Expand Down Expand Up @@ -345,7 +348,7 @@ jobs :
# Unfortunately I don't think we can key this cache based on our project property so
# we clean and rebuild.
arguments : |
clean assembleDebugAndroidTest --stacktrace -Pworkflow.runtime=conflate
clean assembleDebugAndroidTest -Pworkflow.runtime=conflate
cache-read-only: false

## Actual task
Expand All @@ -357,7 +360,7 @@ jobs :
api-level : ${{ matrix.api-level }}
arch : x86_64
# Skip the benchmarks as this is running on emulators
script : ./gradlew connectedCheck -x :benchmarks:dungeon-benchmark:connectedCheck -x :benchmarks:performance-poetry:complex-benchmark:connectedCheck -x :benchmarks:performance-poetry:complex-poetry:connectedCheck --stacktrace -Pworkflow.runtime=conflate
script : ./gradlew connectedCheck -x :benchmarks:dungeon-benchmark:connectedCheck -x :benchmarks:performance-poetry:complex-benchmark:connectedCheck -x :benchmarks:performance-poetry:complex-poetry:connectedCheck -Pworkflow.runtime=conflate

- name : Upload results
if : ${{ always() }}
Expand Down Expand Up @@ -389,7 +392,7 @@ jobs :
if : env.MOBILE_DEV_API_KEY != null
with :
arguments : |
benchmarks:performance-poetry:complex-poetry:assembleRelease --stacktrace
benchmarks:performance-poetry:complex-poetry:assembleRelease
cache-read-only: false
env :
MOBILE_DEV_API_KEY : ${{ secrets.MOBILE_DEV_API_KEY }}
Expand Down
27 changes: 23 additions & 4 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- main
- ray/ui-update

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx5g -Dorg.gradle.daemon=false -Dorg.gradle.logging.stacktrace=all"

jobs:
publish-snapshot :
runs-on : macos-latest
Expand All @@ -23,12 +26,28 @@ jobs:
java-version: 11

- name : Check for -SNAPSHOT version
run: ./gradlew checkVersionIsSnapshot --no-daemon
uses : gradle/gradle-build-action@v2
with :
arguments : checkVersionIsSnapshot
cache-read-only: false

- name : Assemble
uses : gradle/gradle-build-action@v2
with :
arguments : assemble
cache-read-only: false

- name : Check
uses : gradle/gradle-build-action@v2
with :
arguments : check
cache-read-only: false

- name : Publish Snapshots
run: |
./gradlew build --no-daemon
./gradlew publish --no-daemon
uses : gradle/gradle-build-action@v2
with :
arguments : publish
cache-read-only: false
env :
ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets.SONATYPE_NEXUS_PASSWORD }}

0 comments on commit 93f4bac

Please sign in to comment.