Skip to content

Commit

Permalink
build: Will try now to not abort nightly builds on MacOSX notarizatio…
Browse files Browse the repository at this point in the history
…n failure
  • Loading branch information
g-bougard committed Feb 20, 2025
1 parent 94a80b2 commit eeffbe8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/glpi-agent-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ jobs:
NOTARIZE_PASSWORD: ${{ secrets.MACOSX_NOTARIZE_PASSWORD }}
NOTARIZE_TEAMID: ${{ vars.MACOSX_NOTARIZE_TEAMID }}
MACOSX_NOTARIZE: ${{ needs.setup-release.outputs.macosx-notarization }}
TAGNAME: ${{ needs.setup-release.outputs.tag_name }}
shell: bash
- name: List generated files
if: success() || failure()
Expand Down
20 changes: 20 additions & 0 deletions contrib/macosx/glpi-agent-packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,29 @@ cat >pkg/payload/Applications/GLPI-Agent/Contents/Info.plist <<-INFO_PLIST
</plist>
INFO_PLIST

# Disable aborting on error to handle notarization failure
[ "$NOTARIZE" == "yes" ] && set +e

echo "Build package"
./munkipkg pkg

# Analyze return code
if [ "$?" != "0" ]; then
# If pkg file was generated, it means we failed on notarization
# Then we can forget notarization unless on release (nightly build case)
if [ -s "$PKG" -a "$NOTARIZE" == "yes" -a -z "${TAGNAME##nightly-*}" ]; then
echo "By-passing notarization check"
# On Github Actions run, add a warning to the build workflow
[ -n "$GITHUB_REF" ] && echo "::warning title=Notarization failure for MacOSX $PKG build::By-passing notarization check"
NOTARIZE="no"
else
exit 7
fi
fi

# Enable back shell aborting on error
set -e

mv -vf "pkg/build/$PKG" "build/$PKG"

# Signature check
Expand Down

0 comments on commit eeffbe8

Please sign in to comment.