Merge pull request #31 from fortify/release-please--branches--main #91
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| branches: | |
| - '**' | |
| permissions: read-all | |
| name: CI | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Check-out source code | |
| uses: actions/checkout@v4 | |
| - name: Prepare GitHub release | |
| id: create_prod_release | |
| uses: googleapis/release-please-action@v4 | |
| if: github.ref == 'refs/heads/main' | |
| with: | |
| skip-github-pull-request: true | |
| target-branch: ${{ github.ref_name }} | |
| release-type: simple | |
| - name: Define build properties | |
| run: | | |
| echo DO_RELEASE=${{ steps.create_prod_release.outputs.release_created || false }} >> $GITHUB_ENV | |
| - name: Build | |
| run: ./gradlew build | |
| - name: Test publishing to Maven local repo | |
| run: ./gradlew publishToMavenLocal -Dmaven.repo.local=./build/.m2 | |
| env: | |
| ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_SECRET_KEY }} | |
| ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PWD }} | |
| - name: Publish to Maven Central | |
| if: github.ref == 'refs/heads/main' | |
| run: ./gradlew publishToMavenCentral closeAndReleaseMavenCentralStagingRepository -PisReleaseVersion=${{ env.DO_RELEASE }} | |
| env: | |
| ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_SECRET_KEY }} | |
| ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PWD }} | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USER }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
| - name: Prepare release PR | |
| uses: googleapis/release-please-action@v4 | |
| if: github.ref == 'refs/heads/main' | |
| with: | |
| skip-github-release: true | |
| target-branch: ${{ github.ref_name }} | |
| release-type: simple |