-
-
Notifications
You must be signed in to change notification settings - Fork 53
112 lines (108 loc) · 4.35 KB
/
maven-build-all-installer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Build All Installers
on:
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
workflow_dispatch:
branches: [ main ]
env:
DEV_IDENTITY: BXPZTQZ35S # Your Apple Dev identity, something like BXPZTQZ35S
PRIMARY_BUNDLE_ID: com.example.App # Unique to your app, often the launcher class
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Download Wix
uses: i3h/download-release-asset@v1
if: matrix.os == 'windows-latest'
with:
owner: wixtoolset
repo: wix3
tag: wix3112rtm
file: wix311-binaries.zip
- name: Decompress Wix
uses: DuckSoft/extract-7z-action@v1.0
if: matrix.os == 'windows-latest'
with:
pathSource: wix311-binaries.zip
pathTarget: ./target/wix
- name: Add Wix to Path
run: echo "$HOME/target/wix" >> $GITHUB_PATH
if: matrix.os == 'windows-latest'
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 18.0.2
distribution: 'liberica'
java-package: jdk+fx
cache: 'maven'
- name: "Build with Maven"
if: matrix.os != 'macos-latest'
run: mvn -B clean install --file pom.xml
- name: "Build with Maven (macOS No Signing)"
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
if: ${{ env.MACOS_CERTIFICATE == null }} && matrix.os == 'macos-latest'
run: mvn -B clean install --file pom.xml
- name: "Build with Maven (macOS Signed)"
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
if: ${{ env.MACOS_CERTIFICATE != null && matrix.os == 'macos-latest' }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p temppass build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p temppass build.keychain
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k temppass build.keychain
export IDENTITY=$(security find-identity -v)
echo $(security find-identity -v)
mvn -B clean install -Pmacos-sign --file pom.xml
- name: "Codesign DMG"
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
if: ${{ env.MACOS_CERTIFICATE != null && matrix.os == 'macos-latest' }}
run: |
export DMG_PATH=$(ls ./target/*.dmg)
/usr/bin/codesign --deep --force -s ${{ env.DEV_IDENTITY}} $DMG_PATH -v
echo DMG_PATH=$DMG_PATH >> $GITHUB_ENV
echo ${{ env.DMG_PATH }}
- name: "Notarize DMG"
env:
APP_EMAIL: ${{ secrets.APP_EMAIL }}
APP_PASS: ${{ secrets.APP_PASS }}
if: ${{ env.APP_EMAIL != null && matrix.os == 'macos-latest' }}
uses: devbotsxyz/xcode-notarize@v1
with:
product-path: ${{ env.DMG_PATH }}
primary-bundle-id: ${{ env.PRIMARY_BUNDLE_ID }}
appstore-connect-username: ${{ secrets.APP_EMAIL }}
appstore-connect-password: ${{ secrets.APP_PASS }}
- name: "Staple DMG"
env:
APP_EMAIL: ${{ secrets.APP_EMAIL }}
APP_PASS: ${{ secrets.APP_PASS }}
if: ${{ env.APP_EMAIL != null && matrix.os == 'macos-latest' }}
uses: devbotsxyz/xcode-staple@v1
with:
product-path: ${{ env.DMG_PATH }}
- name: Update Automatic Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN}}"
automatic_release_tag: ${{ matrix.os }}
prerelease: true
title: ${{ matrix.os }} Development Build
files: |
${{ env.DMG_PATH }}
./target/*.msi