diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d4347a9c93f..da26253672a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,11 +7,8 @@ name: Deploy and Publish on: - workflow_run: - workflows: ["Build and Test"] - branches: [ master ] - types: - - completed + push: + branches: [ '**' ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -59,65 +56,8 @@ jobs: npm install -g @semantic-release/commit-analyzer npm install -g @semantic-release/release-notes-generator - - name: Check if semantic release generated a release - id: is_new_release - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - echo ::set-output name=IS_NEW_RELEASE::$(npx semantic-release --dry-run | grep -c -i "Published release") - echo "The full TAG - ${{ github.ref }}" - - - name: Get the nextRelease.version from semantic release - if: ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '1' }} - id: next_release - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: echo ::set-output name=NEXT_RELEASE::$(npx semantic-release --dry-run | grep -oP "Published release \K[0-9]+\.[0-9]+\.[0-9]+") - - name: Publish to Git Releases and Tags - if: ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '1' }} env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npx semantic-release # --dry-run --branches 9662_addcheck - - - name: Publish to Maven Central - if: ${{ steps.next_release.outputs.NEXT_RELEASE }} - env: - GHA_TAG: "refs/tags/v${{ steps.next_release.outputs.NEXT_RELEASE }}" # for setMavenVersion_gha - OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} # for .travis.settings.xml - OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - GPG_KEYNAME: ${{ secrets.SIGNING_KEY }} - GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSWORD }} - SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} # for setupSigning_gha - run: | - echo "The NEXT_RELEASE - ${{ steps.next_release.outputs.NEXT_RELEASE }}" - echo -e "\n\033[0;35mCommand: setupSigning" - build/setupSigning_gha.sh - echo -e "\n\033[0;35mCommand: setMavenVersion" - build/setMavenVersion_gha.sh - echo -e "\n\033[0;35mCommand: mvn deploy" - mvn deploy --settings build/.travis.settings.xml -DskipITs -Dskip.unit.tests -P central $MVN_ARGS - - - name: Publish Java docs - if: ${{ steps.next_release.outputs.NEXT_RELEASE }} - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - GHA_REPO_SLUG: ${{ github.repository }} - GHA_BRANCH: ${{ github.ref }} # non PR only need to get last part - GHA_PULL_REQUEST: ${{ github.event.number }} - GHA_BUILD_NUMBER: ${{ github.run_number }} - GHA_JOB_NUMBER: ${{ github.job_number }} - GHA_COMMIT: ${{ github.sha }} - GHA_TAG: "refs/tags/v${{ steps.next_release.outputs.NEXT_RELEASE }}" # for setMavenVersion_gha - run: | - build/setMavenVersion_gha.sh - mvn clean javadoc:aggregate $MVN_ARGS - build/publish_gha.sh - - - name: SKIP - Publish/Deploy to Git and Maven Central - if: ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '0' }} - run: | - echo -e "\n\033[0;35mCommand: Skipping the deployment because semantic release has determined there are no relevant changes that warrent a new release.\n" + run: npx semantic-release --dry-run --branches gha_test