plantuml-release #87
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
| name: PlantUML library release for Eclipse | |
| on: | |
| # activate push trigger only for testing purposes | |
| #push: | |
| # branches: | |
| # - automate-releases | |
| # Triggered by external repository_dispatch event (from plantuml repo) | |
| repository_dispatch: | |
| types: [plantuml-release] | |
| # Temporarily allow manual triggering via GitHub UI | |
| workflow_dispatch: | |
| jobs: | |
| info: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Print Workflow Call Arguments | |
| run: | | |
| echo -e "Workflow was triggered with the following arguments\n\ | |
| PlantUML version: ${{ github.event.client_payload.release }}, \ | |
| snapshot: ${{ github.event.client_payload.snapshot }}, \ | |
| ref: ${{ github.event.client_payload.ref }}, \ | |
| commit: ${{ github.event.client_payload.commit }}" | |
| build: | |
| # igrnore PlantUML snapshot releases (pre-releases), read snapshot flag from repository_dispatch event's payload | |
| if: github.event.client_payload.snapshot == 'false' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| plantuml_version: ${{ steps.update_site.outputs.plantuml_version }} | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Build latest PlantUML lib update site | |
| id: update_site | |
| run: | | |
| export PLANTUML_VERSION=$(./gradlew -q printPlantUmlLibVersion) | |
| echo "plantuml_version=$PLANTUML_VERSION" >> $GITHUB_OUTPUT | |
| ./gradlew updateGhPagesContents --no-daemon | |
| - name: Save artifacts for the git push | |
| uses: actions/upload-artifact@v4 | |
| env: | |
| PLANTUML_VERSION: ${{ steps.update_site.outputs.plantuml_version }} | |
| with: | |
| name: 'gh-pages-update' | |
| path: | | |
| build/gh-pages/composite*.xml | |
| build/gh-pages/p2.index | |
| build/gh-pages/*.md | |
| build/gh-pages/plantuml.lib/${{ env.PLANTUML_VERSION }}/ | |
| if-no-files-found: error | |
| retention-days: 1 | |
| overwrite: true | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| env: | |
| PLANTUML_VERSION: ${{ needs.build.outputs.plantuml_version }} | |
| steps: | |
| - name: Clone GitHub pages | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: gh-pages | |
| - name: Load artifacts for the git push | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: 'gh-pages-update' | |
| - name: Push update site to GitHub pages | |
| # see https://github.com/actions/checkout?tab=readme-ov-file#push-a-commit-using-the-built-in-token | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add --all | |
| git commit -m "Add PlantUML lib update site ver. $PLANTUML_VERSION (triggered by $GITHUB_ACTOR)\n\n\ | |
| See https://github.com/plantuml/plantuml/commit/${{ github.event.client_payload.commit }}" | |
| git push |