diff --git a/.github/workflows/on-push-to-main-branch.yml b/.github/workflows/on-push-to-main-branch.yml index f3ae8b3..8099353 100644 --- a/.github/workflows/on-push-to-main-branch.yml +++ b/.github/workflows/on-push-to-main-branch.yml @@ -5,7 +5,7 @@ on: branches: [main] jobs: - generate-readme-and-prep-release: + generate-readme: runs-on: ubuntu-latest steps: - name: Setup repo @@ -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 }} @@ -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/gradle-build-action@v2.11.1 with: arguments: clean build -x jvmTest -x testDebugUnitTest -x testReleaseUnitTest - if: ${{ steps.release.outputs.src--release_created }} - name: Publish to sonatype env: @@ -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 }}