-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add signing for mac osx. #6748
Merged
Add signing for mac osx. #6748
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
90ff628
update to version 15
Siedlerchr 5c2bdcf
change to 15 ea
Siedlerchr 272b709
lets test with the cert
Siedlerchr abec6a5
run keychain adding only on osx
Siedlerchr ad46c1a
import second cert
Siedlerchr 3069ee1
Update deployment.yml
Siedlerchr a9dbb27
remove windows icon hack
Siedlerchr 1c601b5
Merge branch 'macsign' of github.com:JabRef/jabref into macsign
Siedlerchr c5af100
Fix deploy indendation. Fucking yaml.
Siedlerchr 8f53fa9
set keychain password manually
Siedlerchr abc0b01
Merge remote-tracking branch 'upstream/master' into macsign
Siedlerchr 31f720c
change icon position in dmg setup
Siedlerchr 4d91c16
TODO: find out the corect parameters for the installer vars
Siedlerchr a439125
udpate icons for mac
Siedlerchr d4a63d6
revert to installer variables again
Siedlerchr ef1d996
Use orginal installer variable
Siedlerchr dad340e
remove wrong parameter
Siedlerchr fd58310
Adjust window bounds and position icons
Siedlerchr 8cadbd0
remove obsolete comment
Siedlerchr 39a6b1c
Merge remote-tracking branch 'upstream/master' into macsign
Siedlerchr 4cfbd0f
add basic entitlement to test signing
Siedlerchr 7c786a9
Merge remote-tracking branch 'upstream/master' into macsign
Siedlerchr b5fe951
Merge remote-tracking branch 'upstream/master' into macsign
Siedlerchr c5a44c4
Merge remote-tracking branch 'upstream/master' into macsign
Siedlerchr 685a56c
Merge remote-tracking branch 'upstream/master' into macsign
Siedlerchr b6aa9b8
skip mac installer in jpackage gradle
Siedlerchr 22ff6d0
try fix syntay error
Siedlerchr 1459f04
Update deployment.yml
Siedlerchr 1ca3a5b
fix typo in param
Siedlerchr 41cc815
fix path
Siedlerchr f00544f
fix wrong dir
Siedlerchr ac7cc8b
Fix indent to ease reviewing
koppor f05c730
Fix indent
koppor 5628dca
Refine comments
koppor ad07040
Fix comment char
koppor 4e2fb71
Merge branch 'master' into macsign
koppor a1d0036
Remove empty lines
koppor d4bf9bc
Use Major.Minor version in the file name
koppor d9b14a2
Merge remote-tracking branch 'upstream/master' into macsign
Siedlerchr 5c0a2fb
Merge remote-tracking branch 'upstream/macsign' into macsign
Siedlerchr a6daf13
fix paths
Siedlerchr 4ac2e87
try with java 14
Siedlerchr 74c9d1d
specify path for ea15 to use official openjdk build
Siedlerchr 5670ae3
change to adoptopenjkd action
Siedlerchr 1ab0275
fix
Siedlerchr 68143b1
try without ea
Siedlerchr fdb11b4
specify ea
Siedlerchr 2fffc7a
set fail fast to false
Siedlerchr e68c143
Merge remote-tracking branch 'upstream/master' into macsign
Siedlerchr 514a23a
try with other jdk for linux and win
Siedlerchr e672c24
Merge remote-tracking branch 'upstream/master' into macsign
Siedlerchr 6967acb
Merge remote-tracking branch 'upstream/master' into macsign
Siedlerchr 0410e00
Add notarization for pkg installer as well
Siedlerchr bf6125b
Merge remote-tracking branch 'upstream/macsign' into macsign
Siedlerchr 73a136b
fix missing extension in pkg
Siedlerchr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ env: | |
SpringerNatureAPIKey: ${{ secrets.SpringerNatureAPIKey }} | ||
AstrophysicsDataSystemAPIKey: ${{ secrets.AstrophysicsDataSystemAPIKey }} | ||
IEEEAPIKey: ${{ secrets.IEEEAPIKey }} | ||
OSXCERT: ${{ secrets.OSX_SIGNING_CERT }} | ||
|
||
jobs: | ||
build: | ||
|
@@ -36,10 +37,8 @@ jobs: | |
- os: macOS-latest | ||
displayName: macOS | ||
archivePortable: brew install pigz && tar -c -C build/distribution JabRef.app | pigz --rsyncable > build/distribution/JabRef-portable_macos.tar.gz && rm -R build/distribution/JabRef.app | ||
|
||
runs-on: ${{ matrix.os }} | ||
name: Create installer and portable version for ${{ matrix.displayName }} | ||
|
||
steps: | ||
- name: Fetch all history for all tags and branches | ||
uses: actions/checkout@v2 | ||
|
@@ -48,41 +47,98 @@ jobs: | |
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: '5.2.x' | ||
versionSpec: "5.2.x" | ||
- name: Run GitVersion | ||
id: gitversion | ||
uses: gittools/actions/gitversion/[email protected] | ||
- name: Set up JDK | ||
- name: Set up Adotptopen JDK mac | ||
uses: joschi/setup-jdk@v2 | ||
with: | ||
# reason: https://bugs.openjdk.java.net/browse/JDK-8238184 | ||
java-version: 15 | ||
release_type: ea | ||
if: matrix.os == 'macos-latest' | ||
- name: Set up JDK for linux and windows | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 14 | ||
java-version: 15-ea | ||
if: matrix.os != 'macos-latest' | ||
- name: Restore gradle cache | ||
uses: actions/cache@master | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Setup OSX key chain on OSX | ||
if: matrix.os == 'macos-latest' | ||
uses: apple-actions/import-codesign-certs@v1 | ||
with: | ||
p12-file-base64: ${{ secrets.OSX_SIGNING_CERT }} | ||
p12-password: ${{ secrets.OSX_CERT_PWD }} | ||
keychain-password: jabref | ||
- name: Setup OSX key chain on OSX for app id cert | ||
if: matrix.os == 'macos-latest' | ||
uses: apple-actions/import-codesign-certs@v1 | ||
with: | ||
p12-file-base64: ${{ secrets.OSX_SIGNING_CERT_APPLICATION }} | ||
p12-password: ${{ secrets.OSX_CERT_PWD }} | ||
create-keychain: false | ||
keychain-password: jabref | ||
- name: Build runtime image | ||
run: ./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jlinkZip | ||
- name: Build installer | ||
run: ./gradlew -i -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jpackage | ||
shell: bash | ||
- name: Resign app image for OSX and build dmg | ||
if: matrix.os == 'macos-latest' | ||
shell: bash | ||
run: | | ||
codesign --entitlements buildres/mac/myapp.entitlements --options runtime -vvv -f --sign "Developer ID Application: Tobias Diez (W2PU6LW5U5)" build/distribution/JabRef.app/Contents/runtime/Contents/MacOS/libjli.dylib | ||
codesign --entitlements buildres/mac/myapp.entitlements --options runtime -vvv -f --sign "Developer ID Application: Tobias Diez (W2PU6LW5U5)" build/distribution/JabRef.app/Contents/MacOS/JabRef | ||
codesign --entitlements buildres/mac/myapp.entitlements --options runtime -vvv -f --sign "Developer ID Application: Tobias Diez (W2PU6LW5U5)" build/distribution/JabRef.app | ||
jpackage --type pkg --dest build/distribution --name JabRef --app-version "${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}" --app-image build/distribution/JabRef.app --verbose --type dmg --vendor JabRef --app-version "${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}" --file-associations buildres/mac/bibtexAssociations.properties --resource-dir buildres/mac | ||
codesign -s "Developer ID Application: Tobias Diez (W2PU6LW5U5)" --options runtime --entitlements buildres/mac/myapp.entitlements -vvvv --deep "build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}.dmg" | ||
REQUEST_UUID=$(xcrun altool --verbose --notarize-app --primary-bundle-id "org.jabref" --username ${{ secrets.OSX_NOTARIZATION_APP_USERNAME }} --password ${{ secrets.OSX_NOTARIZATION_APP_PWD }} --asc-provider "W2PU6LW5U5" --file "build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}.dmg" | grep RequestUUID | awk '{print $3}') | ||
while xcrun altool --notarization-info "$REQUEST_UUID" -u ${{ secrets.OSX_NOTARIZATION_APP_USERNAME }} -p ${{ secrets.OSX_NOTARIZATION_APP_PWD }} | grep "Status: in progress" > /dev/null; do | ||
echo "Verification in progress..." | ||
sleep 30 | ||
done | ||
xcrun stapler staple "build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}.dmg" | ||
spctl -vvv --assess --type exec build/distribution/JabRef.app | ||
codesign -vvv --deep --strict "build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}.dmg" | ||
codesign -dvv "build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}.dmg" | ||
- name: Build, sign and notarize pkg installer for OSX | ||
if: matrix.os == 'macos-latest' | ||
shell: bash | ||
run: | | ||
jpackage --type pkg --dest build/distribution --name JabRef --app-version "${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}" --app-image build/distribution/JabRef.app --verbose --type pkg --vendor JabRef --app-version "${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}" --file-associations buildres/mac/bibtexAssociations.properties --resource-dir buildres/mac | ||
productsign --sign "Developer ID Installer: Tobias Diez (W2PU6LW5U5)" "build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}.pkg" "build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-signed.pkg" | ||
REQUEST_UUID=$(xcrun altool --verbose --notarize-app --primary-bundle-id "org.jabref" --username ${{ secrets.OSX_NOTARIZATION_APP_USERNAME }} --password ${{ secrets.OSX_NOTARIZATION_APP_PWD }} --asc-provider "W2PU6LW5U5" --file "build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-signed.pkg" | grep RequestUUID | awk '{print $3}') | ||
while xcrun altool --notarization-info "$REQUEST_UUID" -u ${{ secrets.OSX_NOTARIZATION_APP_USERNAME }} -p ${{ secrets.OSX_NOTARIZATION_APP_PWD }} | grep "Status: in progress" > /dev/null; do | ||
echo "Verification in progress..." | ||
sleep 30 | ||
done | ||
xcrun stapler staple "build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-signed.pkg" | ||
rm "build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}.pkg" | ||
mv "build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-signed.pkg" "build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}.pkg" | ||
- name: Package application image | ||
run: ${{ matrix.archivePortable }} | ||
shell: bash | ||
run: ${{ matrix.archivePortable }} | ||
- name: Rename files | ||
shell: pwsh | ||
run: | | ||
get-childitem -Path build/distribution/* | ||
get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "${{ steps.gitversion.outputs.AssemblySemVer }}","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}"} | ||
get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "portable","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-portable"} | ||
shell: pwsh | ||
- name: Upload to GitHub workflow artifacts store | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: JabRef-${{ matrix.displayName }} | ||
path: build/distribution | ||
deploy: | ||
strategy: | ||
fail-fast: false | ||
name: Deploy binaries on builds.jabref.org | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
|
@@ -137,4 +193,3 @@ jobs: | |
ssh_options: '-p 9922' | ||
src: 'build/distribution/' | ||
dest: [email protected]:/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
tell application "Finder" | ||
set theDisk to a reference to (disks whose URL = "DEPLOY_VOLUME_URL") | ||
open theDisk | ||
|
||
set theWindow to a reference to (container window of disks whose URL = "DEPLOY_VOLUME_URL") | ||
|
||
set current view of theWindow to icon view | ||
set toolbar visible of theWindow to false | ||
set statusbar visible of theWindow to false | ||
|
||
-- size of window should fit the size of background | ||
set the bounds of theWindow to {346, 100, 920, 500} | ||
|
||
set theViewOptions to a reference to the icon view options of theWindow | ||
set arrangement of theViewOptions to not arranged | ||
set icon size of theViewOptions to 128 | ||
|
||
set background picture of theViewOptions to POSIX file "DEPLOY_BG_FILE" | ||
|
||
-- Create alias for install location | ||
make new alias file at POSIX file "DEPLOY_VOLUME_PATH" to POSIX file "DEPLOY_INSTALL_LOCATION" with properties {name:"DEPLOY_INSTALL_LOCATION"} | ||
|
||
set allTheFiles to the name of every item of theWindow | ||
repeat with theFile in allTheFiles | ||
set theFilePath to POSIX path of theFile | ||
if theFilePath is "DEPLOY_INSTALL_LOCATION" then | ||
-- Position install location | ||
set position of item theFile of theWindow to {430, 170} | ||
else | ||
-- Position application or runtime | ||
set position of item theFile of theWindow to {140, 170} | ||
end if | ||
end repeat | ||
|
||
update theDisk without registering applications | ||
delay 5 | ||
close (get window of theDisk) | ||
end tell |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Mac Resources | ||
|
||
## Modifying DMG Setup scpt | ||
|
||
Rename `JabRef-dmg-setup.scpt script` to `JabRef-dmg-setup.applescript`. | ||
Only modify the `JabRef-dmg-setup.applescript` in the OS X Script Editor. Afterwards copy over the file and rename it to `JabRef-dmg-setup.scpt`. | ||
Normally the `scpt` file is a binary compiled variant and the `.applescript` the uncompiled format but jpackage expects the sctp in uncompiled format | ||
|
||
## Generate iconsets | ||
|
||
To generate icns files use the script under `src/main/resources/icons` | ||
Install [svg2png](https://formulae.brew.sh/formula/svg2png) and call the script with the svg filename as first argument. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>com.apple.security.app-sandbox</key> | ||
<false/> | ||
<key>com.apple.security.network.server</key> | ||
<true/> | ||
<key>com.apple.security.network.client</key> | ||
<true/> | ||
<key>com.apple.security.files.user-selected.read-write</key> | ||
<true/> | ||
<key>com.apple.security.cs.allow-jit</key> | ||
<true/> | ||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key> | ||
<true/> | ||
<key>com.apple.security.cs.disable-executable-page-protection</key> | ||
<true/> | ||
<key>com.apple.security.cs.disable-library-validation</key> | ||
<true/> | ||
<key>com.apple.security.cs.allow-dyld-environment-variables</key> | ||
<true/> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>com.apple.security.app-sandbox</key> | ||
<false/> | ||
<key>com.apple.security.network.server</key> | ||
<true/> | ||
<key>com.apple.security.network.client</key> | ||
<true/> | ||
<key>com.apple.security.files.user-selected.read-write</key> | ||
<true/> | ||
<key>com.apple.security.cs.allow-jit</key> | ||
<true/> | ||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key> | ||
<true/> | ||
<key>com.apple.security.cs.disable-executable-page-protection</key> | ||
<true/> | ||
<key>com.apple.security.cs.disable-library-validation</key> | ||
<true/> | ||
<key>com.apple.security.cs.allow-dyld-environment-variables</key> | ||
<true/> | ||
</dict> | ||
</plist> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
SIZES=" | ||
16,16x16 | ||
32,16x16@2x | ||
32,32x32 | ||
64,32x32@2x | ||
128,128x128 | ||
256,128x128@2x | ||
256,256x256åç | ||
512,256x256@2x | ||
512,512x512 | ||
1024,512x512@2x | ||
" | ||
|
||
for SVG in "$@"; do | ||
BASE=$(basename "$SVG" | sed 's/\.[^\.]*$//') | ||
ICONSET="$BASE.iconset" | ||
mkdir -p "$ICONSET" | ||
for PARAMS in $SIZES; do | ||
SIZE=$(echo $PARAMS | cut -d, -f1) | ||
LABEL=$(echo $PARAMS | cut -d, -f2) | ||
svg2png "$SVG" -w $SIZE -h $SIZE "$ICONSET"/icon_$LABEL.png | ||
done | ||
|
||
iconutil -c icns "$ICONSET" | ||
rm -rf "$ICONSET" | ||
done |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to upgrade to 15?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of this bug https://bugs.openjdk.java.net/browse/JDK-8238184