|
| 1 | +# This workflow uses actions that are not certified by GitHub. |
| 2 | +# They are provided by a third-party and are governed by |
| 3 | +# separate terms of service, privacy policy, and support documentation. |
| 4 | +# This workflow will download a prebuilt Java version, install dependencies, build and deploy/publish a new release |
| 5 | +# For more information see: https://docs.github.com/en/actions/guides/building-and-testing-java-with-maven |
| 6 | + |
| 7 | +name: Deploy and Publish |
| 8 | + |
| 9 | +on: |
| 10 | + push: |
| 11 | + branches: [ '**' ] |
| 12 | + |
| 13 | + # Allows you to run this workflow manually from the Actions tab |
| 14 | + workflow_dispatch: |
| 15 | + |
| 16 | +jobs: |
| 17 | + deploy: |
| 18 | + if: "!contains(github.event.head_commit.message, 'skip ci')" |
| 19 | + name: Deploy and Publish |
| 20 | + runs-on: ubuntu-latest |
| 21 | + |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v2 |
| 24 | + with: |
| 25 | + persist-credentials: false |
| 26 | + |
| 27 | + - name: Set up Java |
| 28 | + uses: actions/setup-java@v2 |
| 29 | + with: |
| 30 | + java-version: '8' |
| 31 | + distribution: 'adopt' |
| 32 | + |
| 33 | + - name: Build Java package |
| 34 | + env: |
| 35 | + MVN_ARGS: '-B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' |
| 36 | + run: mvn verify -fae -DskipITs -Dskip.unit.tests $MVN_ARGS |
| 37 | + |
| 38 | + - name: Setup Node |
| 39 | + uses: actions/setup-node@v1 |
| 40 | + with: |
| 41 | + node-version: 12 |
| 42 | + |
| 43 | + - name: Install Semantic Release dependencies |
| 44 | + run: | |
| 45 | + sudo apt-get install bumpversion |
| 46 | + npm install -g semantic-release |
| 47 | + npm install -g @semantic-release/changelog |
| 48 | + npm install -g @semantic-release/exec |
| 49 | + npm install -g @semantic-release/git |
| 50 | + npm install -g @semantic-release/github |
| 51 | + npm install -g @semantic-release/commit-analyzer |
| 52 | + npm install -g @semantic-release/release-notes-generator |
| 53 | +
|
| 54 | + - name: Publish Java docs |
| 55 | + env: |
| 56 | + GH_TOKEN: ${{ secrets.GH_TOKEN }} |
| 57 | + GHA_REPO_SLUG: ${{ github.repository }} |
| 58 | + GHA_BRANCH: ${{ github.ref }} # non PR only need to get last part |
| 59 | + # GHA_PULL_REQUEST: ${{ github.event.number }} |
| 60 | + GHA_PULL_REQUEST: 'true' |
| 61 | + GHA_BUILD_NUMBER: ${{ github.run_number }} |
| 62 | + GHA_JOB_NUMBER: ${{ github.job_number }} |
| 63 | + GHA_COMMIT: ${{ github.sha }} |
| 64 | + GHA_TAG: ${{ github.event.release.tag_name }} |
| 65 | + # TRAVIS_TAG: ${{ github.event.release.tag_name }} |
| 66 | + run: | |
| 67 | + build/setMavenVersion.sh |
| 68 | + mvn clean javadoc:aggregate |
| 69 | + build/publish_gha.sh |
0 commit comments