name: Main on: push: tags: - "v*" jobs: build-jdk11: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: fetch-depth: 0 - uses: actions/setup-java@v2 with: distribution: "zulu" java-version: 11 check-latest: true cache: "maven" - name: get tag name id: version run: echo ::set-output name=VERSION::${GITHUB_REF#refs/*/} - name: build with maven run: mvn --batch-mode --define java.net.useSystemProxies=true package - name: create renamed build run: cp target/plantuml.war target/plantuml-${{ steps.version.outputs.VERSION }}.war - 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 uses: actions/upload-artifact@v2 with: name: war-jre11 path: target/plantuml*-${{ steps.version.outputs.VERSION }}.war build-jdk8: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: fetch-depth: 0 - uses: actions/setup-java@v2 with: distribution: "zulu" java-version: 8 check-latest: true cache: "maven" - name: get tag name id: version run: echo ::set-output name=VERSION::${GITHUB_REF#refs/*/} - 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 uses: actions/upload-artifact@v2 with: 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) uses: actions/download-artifact@v2 with: name: war-jre8 path: artifacts - name: retrieve generated war files (jre11) uses: actions/download-artifact@v2 with: 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 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: artifacts/plantuml*.war tag: ${{ github.ref }} overwrite: true file_glob: true