Skip to content

Commit

Permalink
update Binary Metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
pankaj443 committed Jun 14, 2024
1 parent 7b23b29 commit 8b60b80
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 29 deletions.
49 changes: 32 additions & 17 deletions .github/workflows/executable.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Build Executables
on:
release:
types: [published]
push:
pull_request:
workflow_dispatch:
jobs:
build:
name: Build Executables
Expand All @@ -26,14 +27,14 @@ jobs:
with:
name: win-exe
path: percy.exe
- name: Upload assets
uses: softprops/action-gh-release@d99959edae48b5ffffd7b00da66dcdb0a33a52ee
with:
files: |
percy-osx.zip
percy-linux.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Upload assets
# uses: softprops/action-gh-release@d99959edae48b5ffffd7b00da66dcdb0a33a52ee
# with:
# files: |
# percy-osx.zip
# percy-linux.zip
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
notify:
needs: build
name: Sign Win Executable
Expand All @@ -43,6 +44,20 @@ jobs:
uses: actions/download-artifact@v4
with:
name: win-exe
- name: Download rcedit
run: |
Invoke-WebRequest -Uri https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe -OutFile rcedit.exe
- name: Edit metadata
run: |
./rcedit.exe "./percy.exe" \
--set-version-string CompanyName "BrowserStack Inc." \
--set-version-string FileDescription "Percy CLI Binary" \
--set-version-string FileVersion "1.28.8" \
--set-version-string InternalName "PercyCLI" \
--set-version-string LegalCopyright "Copyright BrowserStack Limited" \
--set-version-string OriginalFilename "PercyCLI" \
--set-version-string ProductName "PercyCLI" \
--set-version-string ProductVersion "1.28.8"
- name: Sign binary
uses: lando/code-sign-action@v2
with:
Expand All @@ -53,10 +68,10 @@ jobs:
run: ./percy.exe --version
- run: |
powershell -Command "Compress-Archive -Path 'percy.exe' -DestinationPath 'percy-win.zip'"
- name: Upload assets
uses: softprops/action-gh-release@d99959edae48b5ffffd7b00da66dcdb0a33a52ee
with:
files: |
percy-win.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Upload assets
# uses: softprops/action-gh-release@d99959edae48b5ffffd7b00da66dcdb0a33a52ee
# with:
# files: |
# percy-win.zip
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 12 additions & 12 deletions scripts/executable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,24 @@ mv run-linux percy && chmod +x percy
mv run-macos percy-osx && chmod +x percy-osx
mv run-win.exe percy.exe && chmod +x percy.exe

# Sign & Notrize mac app
echo "$APPLE_DEV_CERT" | base64 -d > AppleDevIDApp.p12
# # Sign & Notrize mac app
# echo "$APPLE_DEV_CERT" | base64 -d > AppleDevIDApp.p12

security create-keychain -p percy percy.keychain
security import AppleDevIDApp.p12 -t agg -k percy.keychain -P $APPLE_CERT_KEY -A
security list-keychains -s ~/Library/Keychains/percy.keychain
security default-keychain -s ~/Library/Keychains/percy.keychain
security unlock-keychain -p "percy" ~/Library/Keychains/percy.keychain
security set-keychain-settings -t 3600 -l ~/Library/Keychains/percy.keychain
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k percy ~/Library/Keychains/percy.keychain-db
# security create-keychain -p percy percy.keychain
# security import AppleDevIDApp.p12 -t agg -k percy.keychain -P $APPLE_CERT_KEY -A
# security list-keychains -s ~/Library/Keychains/percy.keychain
# security default-keychain -s ~/Library/Keychains/percy.keychain
# security unlock-keychain -p "percy" ~/Library/Keychains/percy.keychain
# security set-keychain-settings -t 3600 -l ~/Library/Keychains/percy.keychain
# security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k percy ~/Library/Keychains/percy.keychain-db

codesign --force --verbose=4 -s "Developer ID Application: BrowserStack Inc ($APPLE_TEAM_ID)" --options runtime --entitlements scripts/files/entitlement.plist --keychain ~/Library/Keychains/percy.keychain percy-osx
# codesign --force --verbose=4 -s "Developer ID Application: BrowserStack Inc ($APPLE_TEAM_ID)" --options runtime --entitlements scripts/files/entitlement.plist --keychain ~/Library/Keychains/percy.keychain percy-osx

# Create zip file for uploading as assets
zip percy-linux.zip percy
mv percy-osx percy
zip percy-osx.zip percy

xcrun notarytool submit --apple-id "$APPLE_ID_USERNAME" --password $APPLE_ID_KEY --team-id $APPLE_TEAM_ID percy-osx.zip --wait
# xcrun notarytool submit --apple-id "$APPLE_ID_USERNAME" --password $APPLE_ID_KEY --team-id $APPLE_TEAM_ID percy-osx.zip --wait

cleanup
# cleanup

0 comments on commit 8b60b80

Please sign in to comment.