fix(nodejs)

This commit is contained in:
Jacob Heider 2023-02-21 15:33:16 -05:00 committed by Jacob Heider
parent bd75123643
commit f37576096c

View file

@ -11,7 +11,7 @@ inputs:
description: Identity to use for signing description: Identity to use for signing
required: true required: true
paths: paths:
description: Paths to search for libs/bins sign description: Paths to search for files to sign
required: true required: true
runs: runs:
@ -37,49 +37,35 @@ runs:
p12-file-base64: ${{ inputs.p12-file-base64 }} p12-file-base64: ${{ inputs.p12-file-base64 }}
p12-password: ${{ inputs.p12-password }} p12-password: ${{ inputs.p12-password }}
# Codesign libs and bins
- name: Find libs and bins
id: find
shell: bash
run: |
for PATH in $PATHS; do
LIBS="$(/usr/bin/find $PATH -name '*.so' -or -name '*.dylib' -or -name '*.bundle')"
if test -d $PATH/bin; then
BINS="$(/usr/bin/find $PATH/bin -type f)"
fi
done
echo -e "files<<EOF\n$LIBS\n$BINS\nEOF" >> $GITHUB_OUTPUT
env:
PATHS: ${{ inputs.paths }}
- name: Codesign files - name: Codesign files
shell: bash shell: sh
run: | run: |
echo "$FILES" | /usr/bin/xargs /usr/bin/codesign -s "$IDENTITY" --force -v --deep \ find $PATHS -type f -print0 | \
--timestamp --preserve-metadata=entitlements -o runtime || true xargs -0 /usr/bin/codesign -s "$IDENTITY" --force -v \
--timestamp || true
env: env:
FILES: ${{ steps.find.outputs.files }} PATHS: ${{ inputs.paths }}
IDENTITY: ${{ inputs.identity }} IDENTITY: ${{ inputs.identity }}
# This isn't very informative, but even a no-op is safer than none # This isn't very informative, but even a no-op is safer than none
- name: Check codesigning - name: Check codesigning
shell: bash shell: sh
run: | run: |
for FILE in $FILES; do for FILE in $(find $PATHS -type f); do
# FIXME: `deno` compiled binaries don't currently pass validation. # FIXME: `deno` compiled binaries don't currently pass validation.
# https://github.com/denoland/deno/issues/17753 # https://github.com/denoland/deno/issues/17753
if test "$(/usr/bin/basename "$FILE")" = "tea"; then if test "$(basename "$FILE")" = "tea"; then
continue continue
fi fi
/usr/bin/codesign -vvv --deep --strict "$FILE" codesign -vvv --strict "$FILE"
done done
env: env:
FILES: ${{ steps.find.outputs.files }} PATHS: ${{ inputs.paths }}
# Needed for self-hosted runner, since it doesn't destroy itself automatically. # Needed for self-hosted runner, since it doesn't destroy itself automatically.
- name: Delete keychain - name: Delete keychain
if: always() if: always()
shell: bash shell: sh
run: /usr/bin/security delete-keychain signing_temp.keychain run: security delete-keychain signing_temp.keychain