|
| 1 | +# This workflow will build a Java project with Maven |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven |
| 3 | + |
| 4 | +name: Java CI with Maven |
| 5 | + |
| 6 | +env: |
| 7 | + install4j_download_url: https://download-gcdn.ej-technologies.com/install4j/install4j_linux-x64_9_0_2.tar.gz |
| 8 | + |
| 9 | +on: |
| 10 | + push: |
| 11 | + pull_request: |
| 12 | + workflow_dispatch: |
| 13 | + inputs: |
| 14 | + install4j_download_url: |
| 15 | + description: Download source for Install4J |
| 16 | + required: true |
| 17 | + default: https://download-gcdn.ej-technologies.com/install4j/install4j_linux-x64_9_0_2.tar.gz |
| 18 | + |
| 19 | +jobs: |
| 20 | + build: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + environment: install4j |
| 23 | + strategy: |
| 24 | + matrix: |
| 25 | + java: [ 16 ] |
| 26 | + |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v2 |
| 29 | + - name: Set up JDK ${{ matrix.java }} |
| 30 | + uses: actions/setup-java@v2 |
| 31 | + with: |
| 32 | + java-version: ${{ matrix.java }} |
| 33 | + distribution: 'adopt' |
| 34 | + - name: Build with Maven |
| 35 | + run: mvn -B -Djava.version=${{ matrix.java }} -Dopenjfx.version=${{ matrix.java }} compile test |
| 36 | + |
| 37 | + |
| 38 | + package: |
| 39 | + runs-on: ubuntu-latest |
| 40 | + needs: build |
| 41 | + if: ${{ startsWith(github.ref, 'refs/tags/') }} |
| 42 | + strategy: |
| 43 | + matrix: |
| 44 | + java: [ 16 ] |
| 45 | + |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v2 |
| 48 | + - name: Set up JDK ${{ matrix.java }} |
| 49 | + uses: actions/setup-java@v2 |
| 50 | + with: |
| 51 | + java-version: ${{ matrix.java }} |
| 52 | + distribution: 'adopt' |
| 53 | + - name: Download install4j |
| 54 | + run: | |
| 55 | + wget --tries=3 ${{ github.event.inputs.install4j_download_url || env.install4j_download_url }} -O install4j.tar.gz |
| 56 | + mkdir install4j |
| 57 | + tar -zxvf install4j.tar.gz --strip-components 1 -C install4j |
| 58 | + - name: Configure Install4J |
| 59 | + env: |
| 60 | + LICENSE_KEY_9: ${{ secrets.INSTALL4J_LICENSE_KEY }} |
| 61 | + run: mvn install4j:install-license |
| 62 | + - name: Package with maven and install4j |
| 63 | + run: mvn -B -Dinstall4j.home=install4j -Djava.version=${{ matrix.java }} -Dopenjfx.version=${{ matrix.java }} package |
0 commit comments