|
| 1 | +# This workflow will build a Java project with Maven and bundle them as native app installers with jDeploy |
| 2 | +# See https://www.jdeploy.com for more information. |
| 3 | + |
| 4 | +name: jDeploy CI |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: ['*', '!gh-pages'] |
| 9 | + tags: ['*'] |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + permissions: |
| 14 | + contents: write |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v3 |
| 19 | + - name: Set up JDK 21 |
| 20 | + uses: actions/setup-java@v3 |
| 21 | + with: |
| 22 | + java-version: '21' |
| 23 | + distribution: 'temurin' |
| 24 | + - name: Build with Maven |
| 25 | + run: mvn clean package -q |
| 26 | + - name: Build App Installer Bundles |
| 27 | + uses: shannah/jdeploy@master |
| 28 | + with: |
| 29 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 30 | + - name: Upload Build Artifacts for DMG Action |
| 31 | + if: ${{ vars.JDEPLOY_CREATE_DMG == 'true' }} # Only needed if creating DMG |
| 32 | + uses: actions/upload-artifact@v4 |
| 33 | + with: |
| 34 | + name: build-target |
| 35 | + path: ./target |
| 36 | + |
| 37 | + create_and_upload_dmg: |
| 38 | + # Enable DMG creation by setting JDEPLOY_CREATE_DMG variable on the repo. |
| 39 | + # See https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#creating-configuration-variables-for-an-environment |
| 40 | + if: ${{ vars.JDEPLOY_CREATE_DMG == 'true' }} |
| 41 | + name: Create and upload DMG |
| 42 | + permissions: |
| 43 | + contents: write |
| 44 | + runs-on: macos-latest |
| 45 | + needs: build |
| 46 | + steps: |
| 47 | + - name: Set up Git |
| 48 | + run: | |
| 49 | + git config --global user.email "${{ github.actor }}@users.noreply.github.com" |
| 50 | + git config --global user.name "${{ github.actor }}" |
| 51 | + - uses: actions/checkout@v3 |
| 52 | + - name: Download Build Artifacts |
| 53 | + uses: actions/download-artifact@v4 |
| 54 | + with: |
| 55 | + name: build-target |
| 56 | + path: ./target |
| 57 | + - name: Create DMG and Upload to Release |
| 58 | + uses: shannah/jdeploy-action-dmg@main |
| 59 | + with: |
| 60 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 61 | + developer_id: ${{ secrets.MAC_DEVELOPER_ID }} |
| 62 | + # Team ID and cert name only needed if it can't extract from the certifcate for some reason |
| 63 | + # developer_team_id: ${{ secrets.MAC_DEVELOPER_TEAM_ID }} |
| 64 | + # developer_certificate_name: ${{ secrets.MAC_DEVELOPER_CERTIFICATE_NAME }} |
| 65 | + developer_certificate_p12_base64: ${{ secrets.MAC_DEVELOPER_CERTIFICATE_P12_BASE64 }} |
| 66 | + developer_certificate_password: ${{ secrets.MAC_DEVELOPER_CERTIFICATE_PASSWORD }} |
| 67 | + notarization_password: ${{ secrets.MAC_NOTARIZATION_PASSWORD }} |
0 commit comments