2021-09-10 16:52:41 +00:00
|
|
|
name: Main
|
2021-10-12 15:51:35 +00:00
|
|
|
|
2021-09-10 16:52:41 +00:00
|
|
|
on:
|
2021-09-10 21:51:13 +00:00
|
|
|
push:
|
|
|
|
tags:
|
2021-09-17 16:42:25 +00:00
|
|
|
- "v*"
|
2021-09-10 16:52:41 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-10-15 13:11:55 +00:00
|
|
|
build-jdk11:
|
2021-09-10 16:52:41 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-03-21 13:12:20 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-09-17 16:42:25 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-10-12 15:51:35 +00:00
|
|
|
|
2023-03-21 13:12:20 +00:00
|
|
|
- uses: actions/setup-java@v3
|
2021-09-17 16:42:25 +00:00
|
|
|
with:
|
2021-10-15 13:11:55 +00:00
|
|
|
distribution: "zulu"
|
|
|
|
java-version: 11
|
2021-09-17 16:42:25 +00:00
|
|
|
check-latest: true
|
|
|
|
cache: "maven"
|
2021-09-10 16:52:41 +00:00
|
|
|
|
2021-09-17 16:42:25 +00:00
|
|
|
- name: get tag name
|
|
|
|
id: version
|
2023-03-21 13:12:20 +00:00
|
|
|
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
|
2021-09-10 16:52:41 +00:00
|
|
|
|
2021-10-15 13:11:55 +00:00
|
|
|
- name: build with maven
|
|
|
|
run: mvn --batch-mode --define java.net.useSystemProxies=true package
|
|
|
|
|
2021-09-17 16:42:25 +00:00
|
|
|
- name: create renamed build
|
|
|
|
run: cp target/plantuml.war target/plantuml-${{ steps.version.outputs.VERSION }}.war
|
2021-09-10 16:52:41 +00:00
|
|
|
|
2021-10-15 13:11:55 +00:00
|
|
|
- name: build with maven (including the apache-jsp artifact)
|
|
|
|
run: mvn --batch-mode --define java.net.useSystemProxies=true -Dapache-jsp.scope=compile package
|
|
|
|
|
|
|
|
- name: create renamed build (including the apache-jsp artifact)
|
|
|
|
run: cp target/plantuml.war target/plantuml-jsp-${{ steps.version.outputs.VERSION }}.war
|
|
|
|
|
|
|
|
- name: temporarily save generated war files
|
2023-03-21 13:12:20 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-09-17 16:42:25 +00:00
|
|
|
with:
|
2021-10-15 13:11:55 +00:00
|
|
|
name: war-jre11
|
|
|
|
path: target/plantuml*-${{ steps.version.outputs.VERSION }}.war
|
2021-09-10 17:39:14 +00:00
|
|
|
|
2021-10-15 13:11:55 +00:00
|
|
|
build-jdk8:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-03-21 13:12:20 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-09-17 16:42:25 +00:00
|
|
|
with:
|
2021-10-15 13:11:55 +00:00
|
|
|
fetch-depth: 0
|
|
|
|
|
2023-03-21 13:12:20 +00:00
|
|
|
- uses: actions/setup-java@v3
|
2021-10-15 13:11:55 +00:00
|
|
|
with:
|
|
|
|
distribution: "zulu"
|
|
|
|
java-version: 8
|
|
|
|
check-latest: true
|
|
|
|
cache: "maven"
|
|
|
|
|
|
|
|
- name: get tag name
|
|
|
|
id: version
|
2023-03-21 13:12:20 +00:00
|
|
|
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
|
2021-10-15 13:11:55 +00:00
|
|
|
|
|
|
|
- name: Remove test code (not java 8 compatible)
|
|
|
|
run: rm -rf src/test
|
|
|
|
|
|
|
|
- name: build with maven
|
|
|
|
run: mvn --batch-mode -f pom.jdk8.xml --define java.net.useSystemProxies=true package
|
|
|
|
|
|
|
|
- name: create renamed build
|
|
|
|
run: cp target/plantuml.war target/plantuml-jre8-${{ steps.version.outputs.VERSION }}.war
|
|
|
|
|
|
|
|
- name: build with maven (including the apache-jsp artifact)
|
|
|
|
run: mvn --batch-mode -f pom.jdk8.xml --define java.net.useSystemProxies=true -Dapache-jsp.scope=compile package
|
|
|
|
|
|
|
|
- name: create renamed build (including the apache-jsp artifact)
|
|
|
|
run: cp target/plantuml.war target/plantuml-jre8-jsp-${{ steps.version.outputs.VERSION }}.war
|
|
|
|
|
|
|
|
- name: temporarily save generated war files
|
2023-03-21 13:12:20 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-09-17 16:42:25 +00:00
|
|
|
with:
|
2021-10-15 13:11:55 +00:00
|
|
|
name: war-jre8
|
|
|
|
path: target/plantuml*-${{ steps.version.outputs.VERSION }}.war
|
|
|
|
|
|
|
|
publish-releases:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs:
|
|
|
|
- build-jdk11
|
|
|
|
- build-jdk8
|
|
|
|
steps:
|
|
|
|
- name: retrieve generated war files (jre8)
|
2023-03-21 13:12:20 +00:00
|
|
|
uses: actions/download-artifact@v3
|
2021-09-17 16:42:25 +00:00
|
|
|
with:
|
2021-10-15 13:11:55 +00:00
|
|
|
name: war-jre8
|
|
|
|
path: artifacts
|
2021-09-10 17:39:14 +00:00
|
|
|
|
2021-10-15 13:11:55 +00:00
|
|
|
- name: retrieve generated war files (jre11)
|
2023-03-21 13:12:20 +00:00
|
|
|
uses: actions/download-artifact@v3
|
2021-09-17 16:42:25 +00:00
|
|
|
with:
|
2021-10-15 13:11:55 +00:00
|
|
|
name: war-jre11
|
|
|
|
path: artifacts
|
|
|
|
|
|
|
|
- name: display structure of downloaded files
|
|
|
|
run: ls -lah artifacts
|
|
|
|
|
|
|
|
- name: upload binaries to release
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
2021-09-17 16:42:25 +00:00
|
|
|
with:
|
2021-10-15 13:11:55 +00:00
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: artifacts/plantuml*.war
|
|
|
|
tag: ${{ github.ref }}
|
|
|
|
overwrite: true
|
|
|
|
file_glob: true
|
2021-11-12 15:36:36 +00:00
|
|
|
|
|
|
|
publish-docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs:
|
|
|
|
- publish-releases
|
|
|
|
steps:
|
2023-03-21 13:12:20 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-11-12 15:36:36 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Docker tomcat meta
|
|
|
|
id: docker_meta_tomcat
|
|
|
|
uses: crazy-max/ghaction-docker-meta@v3
|
|
|
|
with:
|
|
|
|
flavor: |
|
|
|
|
latest=false
|
|
|
|
prefix=
|
|
|
|
suffix=
|
2022-01-26 22:48:43 +00:00
|
|
|
images: plantuml/plantuml-server
|
2021-11-12 15:36:36 +00:00
|
|
|
tags: |
|
|
|
|
type=semver,pattern=tomcat-{{raw}}
|
|
|
|
type=raw,value=tomcat
|
|
|
|
|
|
|
|
- name: Docker jetty meta
|
|
|
|
id: docker_meta_jetty
|
|
|
|
uses: crazy-max/ghaction-docker-meta@v3
|
|
|
|
with:
|
|
|
|
flavor: |
|
|
|
|
latest=true
|
|
|
|
prefix=
|
|
|
|
suffix=
|
2022-01-26 22:48:43 +00:00
|
|
|
images: plantuml/plantuml-server
|
2021-11-12 15:36:36 +00:00
|
|
|
tags: |
|
|
|
|
type=semver,pattern={{raw}}
|
|
|
|
type=semver,pattern=jetty-{{raw}}
|
|
|
|
type=raw,value=jetty
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Build & push tomcat
|
|
|
|
id: docker_build_tomcat
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile.tomcat
|
2022-01-26 22:11:04 +00:00
|
|
|
platforms: linux/amd64, linux/arm64
|
2021-11-12 15:36:36 +00:00
|
|
|
push: true
|
|
|
|
tags: ${{ steps.docker_meta_tomcat.outputs.tags }}
|
|
|
|
labels: ${{ steps.docker_meta_tomcat.outputs.labels }}
|
|
|
|
|
|
|
|
- name: Build & push jetty
|
|
|
|
id: docker_build_jetty
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile.jetty
|
2022-01-26 22:23:27 +00:00
|
|
|
platforms: linux/amd64, linux/arm64
|
2021-11-12 15:36:36 +00:00
|
|
|
push: true
|
|
|
|
tags: ${{ steps.docker_meta_jetty.outputs.tags }}
|
|
|
|
labels: ${{ steps.docker_meta_jetty.outputs.labels }}
|
|
|
|
|
|
|
|
publish-pages:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs:
|
|
|
|
- publish-releases
|
|
|
|
steps:
|
2023-03-21 13:12:20 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-11-12 15:36:36 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2023-03-21 13:12:20 +00:00
|
|
|
- uses: actions/setup-java@v3
|
2021-11-12 15:36:36 +00:00
|
|
|
with:
|
|
|
|
distribution: "zulu"
|
|
|
|
java-version: 11
|
|
|
|
check-latest: true
|
|
|
|
cache: "maven"
|
|
|
|
|
|
|
|
- name: Create GitHub Pages
|
|
|
|
run: mvn site
|
|
|
|
|
|
|
|
- name: Deploy GitHub Pages
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish_dir: ./target/site
|