-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: macos signing and notarization (#367)
See #367
- Loading branch information
Showing
12 changed files
with
331 additions
and
35 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
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
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
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,14 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
PREVIEW_URL="https://dweb.link$CONTENT_PATH" | ||
API_PARAMS=$(jq --monochrome-output --null-input \ | ||
--arg state "success" \ | ||
--arg target_url "$PREVIEW_URL" \ | ||
--arg description "Preview updated website on IPFS" \ | ||
--arg context "Preview is ready" \ | ||
'{ state: $state, target_url: $target_url, description: $description, context: $context }' ) | ||
curl --output /dev/null --silent --show-error \ | ||
-X POST -H "Authorization: Bearer $GITHUB_TOKEN" -H 'Content-Type: application/json' \ | ||
--data "$API_PARAMS" 'https://api.github.com/repos/ipfs/distributions/statuses/${GIT_REVISION}' | ||
echo "Pinned to IPFS - $PREVIEW_URL" |
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,28 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
echo "::group::pin add" | ||
ipfs-cluster-ctl --enc=json \ | ||
--host "/dnsaddr/ipfs-websites.collab.ipfscluster.io" \ | ||
--basic-auth "${CLUSTER_USER}:${CLUSTER_PASSWORD}" \ | ||
pin add \ | ||
--name "${PIN_NAME}" \ | ||
--no-status $PIN_ADD_EXTRA_ARGS \ | ||
"$PIN_CID" | ||
echo "::endgroup::" | ||
|
||
echo "::group::waiting until pinned" | ||
while true; do | ||
ipfs-cluster-ctl --enc=json \ | ||
--host "/dnsaddr/ipfs-websites.collab.ipfscluster.io" \ | ||
--basic-auth "${CLUSTER_USER}:${CLUSTER_PASSWORD}" \ | ||
status "$PIN_CID" | tee cluster-pin-status | ||
if [[ $(jq '.peer_map[].status' cluster-pin-status | grep '"pinned"' | wc -l) -ge 2 ]]; then | ||
echo "Got 2 pin confirmations, finishing the workflow" | ||
break | ||
else | ||
echo "(sleeping for 15 seconds)" | ||
sleep 15 | ||
fi | ||
done | ||
echo "::endgroup::" |
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 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
echo "::group::Install go-ipfs and ipfs-cluster-ctl" | ||
curl -s https://dist.ipfs.io/go-ipfs/${GO_IPFS_VER}/go-ipfs_${GO_IPFS_VER}_linux-amd64.tar.gz | sudo tar vzx -C /usr/local/bin/ go-ipfs/ipfs --strip-components=1 | ||
curl -s https://dist.ipfs.io/ipfs-cluster-ctl/${CLUSTER_CTL_VER}/ipfs-cluster-ctl_${CLUSTER_CTL_VER}_linux-amd64.tar.gz | sudo tar vzx -C /usr/local/bin/ ipfs-cluster-ctl/ipfs-cluster-ctl --strip-components=1 | ||
echo "::endgroup::" | ||
|
||
# fix resolv - DNS provided by Github is unreliable for DNSLik/dnsaddr | ||
sudo sed -i -e 's/nameserver 127.0.0.*/nameserver 1.1.1.1/g' /etc/resolv.conf | ||
|
||
# QUIC perf: https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size | ||
sudo sysctl -w net.core.rmem_max=2500000 | ||
|
||
# init ipfs | ||
echo "::group::Set up IPFS daemon" | ||
ipfs init --profile flatfs,server,test,lowpower | ||
# make flatfs async for faster ci | ||
new_config=$( jq '.Datastore.Spec.mounts[0].child.sync = false' ~/.ipfs/config) && echo "${new_config}" > ~/.ipfs/config | ||
# restore deterministic port (changed by test profile) | ||
ipfs config Addresses.API "/ip4/127.0.0.1/tcp/5001" | ||
# wait for ipfs daemon | ||
ipfs daemon --enable-gc=false & while (! ipfs id --api "/ip4/127.0.0.1/tcp/5001"); do sleep 1; done | ||
echo "::endgroup::" | ||
|
||
|
||
echo "::group::Preconnect to cluster peers" | ||
echo '-> preconnect to cluster peers' | ||
ipfs-cluster-ctl --enc=json \ | ||
--host "/dnsaddr/ipfs-websites.collab.ipfscluster.io" \ | ||
--basic-auth "${CLUSTER_USER}:${CLUSTER_PASSWORD}" \ | ||
peers ls > cluster-peers-ls | ||
for maddr in $(jq -r '.[].ipfs.addresses[]?' cluster-peers-ls); do | ||
ipfs swarm connect "$maddr" || continue | ||
done | ||
echo '-> manual connect to cluster.ipfs.io' | ||
ipfs swarm connect /dnsaddr/cluster.ipfs.io | ||
echo '-> list swarm peers' | ||
ipfs swarm peers | ||
echo "::endgroup::" |
Oops, something went wrong.