Skip to content

Commit

Permalink
split generate readme and release job.
Browse files Browse the repository at this point in the history
  • Loading branch information
nand4011 committed Jan 8, 2024
1 parent 060b41f commit 11eb916
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/on-push-to-main-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [main]

jobs:
generate-readme-and-prep-release:
generate-readme:
runs-on: ubuntu-latest
steps:
- name: Setup repo
Expand All @@ -22,8 +22,14 @@ jobs:
sdk_language: Kotlin
dev_docs_slug: kotlin

- name: Update release branch
uses: google-github-actions/release-please-action@v4
release-please:
runs-on: ubuntu-latest
needs: [ generate-readme ]
outputs:
release_created: ${{ steps.release.outputs.release_created }}
name: Release Please
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}
Expand All @@ -34,23 +40,30 @@ jobs:
extra-files: |
build.gradle.kts
publish:
runs-on: ubuntu-latest
needs: [ release-please ]
if: needs.release-please.outputs.release_created == 'true'
steps:
- name: Setup repo
uses: actions/checkout@v4
with:
token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'corretto'
if: ${{ steps.release.outputs.src--release_created }}

# The Android SDK is required to build the project, even if we are not running Android tests.
- name: Setup Android SDK
uses: android-actions/setup-android@v3
if: ${{ steps.release.outputs.src--release_created }}

- name: Build project
uses: gradle/[email protected]
with:
arguments: clean build -x jvmTest -x testDebugUnitTest -x testReleaseUnitTest
if: ${{ steps.release.outputs.src--release_created }}

- name: Publish to sonatype
env:
Expand All @@ -64,4 +77,3 @@ jobs:
# TODO: automatically release when release process is verified to work
# arguments: publishToSonatype closeAndReleaseStagingRepository
arguments: publishToSonatype closeSonatypeStagingRepository
if: ${{ steps.release.outputs.src--release_created }}

0 comments on commit 11eb916

Please sign in to comment.