-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: updating binary distribution to support homebrew (#432)
* chore: codesign for Mac * chore: fix tap GitHub repository * chore: add metadata to the brew tar file * chore: add metadat file before sign * chore: testing ci * chore: testing ci --------- Co-authored-by: Negar Abbasi <[email protected]> Co-authored-by: Altynbek Orumbayev <[email protected]>
- Loading branch information
1 parent
bfc8744
commit 7162a62
Showing
7 changed files
with
185 additions
and
55 deletions.
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
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,40 @@ | ||
name: "Install Apple Developer ID certificate" | ||
description: "Install Apple Developer ID certificate to macos-build keychain" | ||
inputs: | ||
cert_data: | ||
description: "Base64 string represents the Apple developer ID certificate" | ||
required: true | ||
cert_password: | ||
description: "The password to unlock the Apple developer ID certificate" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install cert | ||
shell: bash | ||
env: | ||
APPLE_CERT_DATA: ${{ inputs.cert_data }} | ||
APPLE_CERT_PASSWORD: ${{ inputs.cert_password }} | ||
run: | | ||
# Export certs | ||
echo "$APPLE_CERT_DATA" | base64 --decode > /tmp/certs.p12 | ||
# Create keychain | ||
security create-keychain -p actions macos-build.keychain | ||
security default-keychain -s macos-build.keychain | ||
security unlock-keychain -p actions macos-build.keychain | ||
security set-keychain-settings -t 3600 -u macos-build.keychain | ||
echo "Keychain created" | ||
# Import certs to keychain | ||
security import /tmp/certs.p12 -k ~/Library/Keychains/macos-build.keychain -P "$APPLE_CERT_PASSWORD" -T /usr/bin/codesign -T /usr/bin/productsign | ||
echo "Cert imported" | ||
# Key signing | ||
security set-key-partition-list -S apple-tool:,apple: -s -k actions macos-build.keychain | ||
echo "Key signed" | ||
# Delete temp file | ||
rm /tmp/certs.p12 | ||
echo "Done" |
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Publish packages to public repositories | |
on: | ||
workflow_call: | ||
inputs: | ||
artifactName: | ||
wheelArtifactName: | ||
required: true | ||
type: string | ||
description: "The github artifact holding the wheel file which will be published" | ||
|
@@ -67,24 +67,40 @@ jobs: | |
uses: actions/checkout@v4 | ||
|
||
# Download either via release or provided artifact | ||
- name: Download release | ||
- name: Download wheel from release | ||
if: ${{ github.event_name == 'workflow_dispatch' }} | ||
run: gh release download v${{ inputs.release_version }} --pattern "*.whl" --dir dist | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
- name: Download artifact | ||
- name: Download wheel from artifact | ||
if: ${{ github.event_name == 'workflow_call' }} | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifactName }} | ||
name: ${{ inputs.wheelArtifactName }} | ||
path: dist | ||
|
||
- name: Download macOS binary from release | ||
if: ${{ github.event_name == 'workflow_dispatch' }} | ||
run: gh release download ${{ inputs.release }} --pattern "*-brew.tar.gz" --dir dist | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
- name: Download macOS binary from artifact | ||
uses: actions/download-artifact@v4 | ||
if: ${{ github.event_name == 'workflow_call' }} | ||
with: | ||
name: ${{ inputs.binaryArtifactName }} | ||
path: dist | ||
|
||
- name: Set Git user as GitHub actions | ||
run: git config --global user.email "[email protected]" && git config --global user.name "github-actions" | ||
|
||
- name: ls dist folder | ||
run: ls -la dist | ||
|
||
- name: Update homebrew cask | ||
run: scripts/update-brew-cask.sh "dist/algokit*-py3-none-any.whl" "algorandfoundation/homebrew-tap" | ||
run: scripts/update-brew-cask.sh "dist/algokit*-py3-none-any.whl" "dist/algokit*-macos_arm64-brew.tar.gz" "dist/algokit*-macos_x64-brew.tar.gz" "algorandfoundation/homebrew-tap" | ||
env: | ||
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} | ||
|
||
|
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,10 @@ | ||
<?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.cs.allow-jit</key> | ||
<true/> | ||
<key>com.apple.security.cs.allow-unsigned-executable-memory</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