1- name : Deployment Release for ARM64 - Run manually!
2-
1+ name : Deployment for Arm64
32on :
3+ push :
4+ branches :
5+ - main
6+ - main-release
7+ paths-ignore :
8+ - ' docs/**'
9+ - ' src/test/**'
10+ - ' README.md'
11+ tags :
12+ - ' *'
13+ pull_request :
14+ merge_group :
415 workflow_dispatch :
516 inputs :
617 notarization :
718 type : boolean
8- required : true
9- default : true
10- push :
11- branches :
12- - arm64mac-release
13- - updateArm64Notarization
19+ required : false
20+ default : false
1421
1522env :
1623 SpringerNatureAPIKey : ${{ secrets.SpringerNatureAPIKey }}
@@ -30,19 +37,26 @@ jobs:
3037 strategy :
3138 fail-fast : false
3239 matrix :
33- os : [self-hosted]
3440 include :
35- - os : self-hosted
41+ - os : macos-14
3642 displayName : macOS (Arm64)
3743 suffix : ' _arm64'
3844 runs-on : ${{ matrix.os }}
45+ outputs :
46+ major : ${{ steps.gitversion.outputs.Major }}
47+ minor : ${{ steps.gitversion.outputs.Minor }}
48+ branchname : ${{ steps.gitversion.outputs.branchName }}
3949 name : Create installer and portable version for ${{ matrix.displayName }}
4050 steps :
4151 - name : Check secrets presence
4252 id : checksecrets
4353 shell : bash
4454 run : |
45- [ -n "$BUILDJABREFPRIVATEKEY" ] || exit 1
55+ if [ "$BUILDJABREFPRIVATEKEY" == "" ]; then
56+ echo "secretspresent=NO" >> $GITHUB_OUTPUT
57+ else
58+ echo "secretspresent=YES" >> $GITHUB_OUTPUT
59+ fi
4660 env :
4761 BUILDJABREFPRIVATEKEY : ${{ secrets.buildJabRefPrivateKey }}
4862 - name : Fetch all history for all tags and branches
@@ -61,34 +75,32 @@ jobs:
6175 - name : Setup JDK
6276 uses : actions/setup-java@v4
6377 with :
64- java-version : 21.0.1
78+ java-version : 21.0.2
6579 distribution : ' liberica'
6680 - name : Clean up keychain
6781 run : |
6882 security delete-keychain signing_temp.keychain ${{runner.temp}}/keychain/notarization.keychain || true
69- - name : Setup OSX key chain on macOS
83+ - name : Setup OSX key chain on macOS-arm
84+ if : (steps.checksecrets.outputs.secretspresent == 'YES')
7085 uses : apple-actions/import-codesign-certs@v2
7186 with :
7287 p12-file-base64 : ${{ secrets.OSX_SIGNING_CERT }}
7388 p12-password : ${{ secrets.OSX_CERT_PWD }}
7489 keychain-password : jabref
7590 - name : Setup OSX key chain on OSX for app id cert
91+ if : (steps.checksecrets.outputs.secretspresent == 'YES')
7692 uses : apple-actions/import-codesign-certs@v2
7793 with :
7894 p12-file-base64 : ${{ secrets.OSX_SIGNING_CERT_APPLICATION }}
7995 p12-password : ${{ secrets.OSX_CERT_PWD }}
8096 create-keychain : false
8197 keychain-password : jabref
82- - name : Create notarization keychain
83- run : |
84- mkdir ${{runner.temp}}/keychain
85- security create-keychain -p jabref ${{runner.temp}}/keychain/notarization.keychain
86- security set-keychain-settings ${{runner.temp}}/keychain/notarization.keychain
8798 - name : Setup Gradle
88- uses : gradle/gradle-build-action@v2
99+ uses : gradle/actions/setup-gradle@v3
89100 - name : Prepare merged jars and modules dir (macOS)
90101 run : ./gradlew -i -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" prepareModulesDir
91102 - name : Build dmg (macOS)
103+ if : (steps.checksecrets.outputs.secretspresent == 'YES')
92104 shell : bash
93105 run : |
94106 jpackage \
@@ -113,6 +125,7 @@ jobs:
113125 --file-associations buildres/mac/bibtexAssociations.properties \
114126 --jlink-options --bind-services
115127 - name : Build pkg (macOS)
128+ if : (steps.checksecrets.outputs.secretspresent == 'YES')
116129 shell : bash
117130 run : |
118131 jpackage \
@@ -137,32 +150,85 @@ jobs:
137150 --file-associations buildres/mac/bibtexAssociations.properties \
138151 --jlink-options --bind-services
139152 - name : Rename files with arm64 suffix as well
153+ if : (steps.checksecrets.outputs.secretspresent == 'YES')
140154 shell : bash
141155 run : |
142156 mv build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}.dmg build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-arm64.dmg
143157 mv build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}.pkg build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-arm64.pkg
158+ - name : Setup rsync (macOS)
159+ if : ${{ (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) && (steps.checksecrets.outputs.secretspresent == 'YES') && ((matrix.os == 'macos-14') && !((startsWith(github.ref, 'refs/tags/') || inputs.notarization == true))) }}
160+ run : brew install rsync
161+ - name : Setup SSH key
162+ if : ${{ (steps.checksecrets.outputs.secretspresent == 'YES') && (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) && ((matrix.os != 'macos-14') || !((startsWith(github.ref, 'refs/tags/') || (inputs.notarization == true)))) }}
163+ run : |
164+ echo "${{ secrets.buildJabRefPrivateKey }}" > sshkey
165+ chmod 600 sshkey
166+ - name : Upload to builds.jabref.org (linux, macOS)
167+ # macOS: Negated condition of "Upload to GitHub workflow artifacts store (macOS)"
168+ # Reason: We either upload the non-notarized files - or notarize the files later (and upload these later)
169+ # needs to be on one line; multi line does not work
170+ if : ${{ (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) && (steps.checksecrets.outputs.secretspresent == 'YES') && ((matrix.os == 'ubuntu-latest') || ((matrix.os == 'macos-14') && !((startsWith(github.ref, 'refs/tags/') || inputs.notarization == true)))) }}
171+ shell : bash
172+ run : |
173+ rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }} && rsync" -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ [email protected] :/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ 174+ - name : Upload to GitHub workflow artifacts store (macOS)
175+ if : (matrix.os == 'macos-14') && (steps.checksecrets.outputs.secretspresent == 'YES') && (startsWith(github.ref, 'refs/tags/') || inputs.notarization == true)
176+ uses : actions/upload-artifact@v4
177+ with :
178+ # tbn = to-be-notarized
179+ name : JabRef-macOS-arm-tbn
180+ path : build/distribution
181+ compression-level : 0 # no compression
182+ - name : Upload to GitHub workflow artifacts store
183+ if : (steps.checksecrets.outputs.secretspresent != 'YES')
184+ uses : actions/upload-artifact@v4
185+ with :
186+ # tbn = to-be-notarized
187+ name : JabRef-${{ matrix.os }}
188+ path : build/distribution
189+ compression-level : 0 # no compression
190+
191+ notarize : # outsourced in a separate job to be able to rerun if this fails for timeouts
192+ name : macOS notarization-arm
193+ runs-on : macos-14
194+ needs : [build]
195+ if : ${{ startsWith(github.ref, 'refs/tags/') || inputs.notarization == true }}
196+ steps :
197+ - name : Check secrets presence
198+ id : checksecrets
199+ shell : bash
200+ run : |
201+ if [ "$BUILDJABREFPRIVATEKEY" == "" ]; then
202+ echo "secretspresent=NO" >> $GITHUB_OUTPUT
203+ else
204+ echo "secretspresent=YES" >> $GITHUB_OUTPUT
205+ fi
206+ env :
207+ BUILDJABREFPRIVATEKEY : ${{ secrets.buildJabRefPrivateKey }}
208+ - name : Download from GitHub workflow artifacts store (macOS)
209+ if : (steps.checksecrets.outputs.secretspresent == 'YES')
210+ uses : actions/download-artifact@master
211+ with :
212+ name : JabRef-macOS-arm-tbn
213+ path : build/distribution/
144214 - name : Notarize dmg
145- if : (startsWith(github.ref, 'refs/tags/') || (${{ inputs.notarization }}) )
215+ if : (steps.checksecrets.outputs.secretspresent == 'YES' )
146216 shell : bash
147217 run : |
148- xcrun notarytool store-credentials "notarytool-profile" --apple-id "[email protected] " --team-id "6792V39SK3" --password "${{ secrets.OSX_NOTARIZATION_APP_PWD }}" --keychain ${{runner.temp}}/keychain/notarization.keychain 149- xcrun notarytool submit build/distribution/JabRef-${{ steps.gitversion .outputs.Major }}.${{ steps.gitversion .outputs.Minor }}-arm64.dmg --keychain-profile "notarytool-profile" --keychain ${{runner.temp}}/keychain/notarization.keychain --wait
150- xcrun stapler staple build/distribution/JabRef-${{ steps.gitversion .outputs.Major }}.${{ steps.gitversion .outputs.Minor }}-arm64.dmg
218+ xcrun notarytool store-credentials "notarytool-profile" --apple-id "[email protected] " --team-id "6792V39SK3" --password "${{ secrets.OSX_NOTARIZATION_APP_PWD }}" 219+ xcrun notarytool submit build/distribution/JabRef-${{ needs.build .outputs.major }}.${{ needs.build .outputs.minor }}-arm64.dmg --keychain-profile "notarytool-profile" --wait
220+ xcrun stapler staple build/distribution/JabRef-${{ needs.build .outputs.major }}.${{ needs.build .outputs.minor }}-arm64.dmg
151221 - name : Notarize pkg
152- if : (startsWith(github.ref, 'refs/tags/') || (${{ inputs.notarization }}) )
222+ if : (steps.checksecrets.outputs.secretspresent == 'YES' )
153223 shell : bash
154224 run : |
155- xcrun notarytool store-credentials "notarytool-profile" --apple-id "[email protected] " --team-id "6792V39SK3" --password "${{ secrets.OSX_NOTARIZATION_APP_PWD }}" --keychain ${{runner.temp}}/keychain/notarization.keychain 156- xcrun notarytool submit build/distribution/JabRef-${{ steps.gitversion .outputs.Major }}.${{ steps.gitversion .outputs.Minor }}-arm64.pkg --keychain-profile "notarytool-profile" --keychain ${{runner.temp}}/keychain/notarization.keychain --wait
157- xcrun stapler staple build/distribution/JabRef-${{ steps.gitversion .outputs.Major }}.${{ steps.gitversion .outputs.Minor }}-arm64.pkg
158- - name : Upload with rsync
159- if : ${{ !startsWith(github.ref, 'refs/heads/gh-readonly-queue') }}
225+ xcrun notarytool store-credentials "notarytool-profile" --apple-id "[email protected] " --team-id "6792V39SK3" --password "${{ secrets.OSX_NOTARIZATION_APP_PWD }}" 226+ xcrun notarytool submit build/distribution/JabRef-${{ needs.build .outputs.major }}.${{ needs.build .outputs.minor }}-arm64.pkg --keychain-profile "notarytool-profile" --wait
227+ xcrun stapler staple build/distribution/JabRef-${{ needs.build .outputs.major }}.${{ needs.build .outputs.minor }}-arm64.pkg
228+ - name : Upload to builds.jabref.org
229+ if : (steps.checksecrets.outputs.secretspresent == 'YES')
160230 shell : bash
161231 run : |
162- rsync -Pavz --itemize-changes --stats --partial-dir=/tmp/partial --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }} && rsync" -e 'ssh -p 9922 -i ~/.ssh/id_rsa' build/distribution/ [email protected] :/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ 163- - name : Upload to GitHub workflow artifacts store
164- if : ${{ !startsWith(github.ref, 'refs/heads/gh-readonly-queue') }}
165- uses : actions/upload-artifact@v4
166- with :
167- name : JabRef-${{ matrix.displayName }}
168- path : build/distribution
232+ echo "${{ secrets.buildJabRefPrivateKey }}" > sshkey
233+ chmod 600 sshkey
234+ rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ needs.build.outputs.branchname }} && rsync" -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ [email protected] :/var/www/builds.jabref.org/www/${{ needs.build.outputs.branchname }}/
0 commit comments