File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -43,10 +43,24 @@ jobs:
4343 lib_tmp=$(mktemp -d)
4444 cp /usr/local/opt/gmp/lib/libgmp.a "$lib_tmp"
4545 go build -v -ldflags "-w -s -extldflags -L$lib_tmp" -o redpwnpow-darwin-amd64 ./cmd/redpwnpow
46+ oci_tmp=$(mktemp -d)
47+ ghcr_token=$(curl -f 'https://ghcr.io/token?scope=repository:homebrew/core/gmp:pull' | jq -r .token)
48+ curl -fLH "authorization: Bearer $ghcr_token" https://ghcr.io/v2/homebrew/core/gmp/blobs/sha256:ff4ad8d068ba4c14d146abb454991b6c4f246796ec2538593dc5f04ca7593eec | tar xzC "$oci_tmp" --strip-components=2
49+ lib_tmp=$(mktemp -d)
50+ cp "$oci_tmp/lib/libgmp.a" "$lib_tmp"
51+ export SDK_NAME=macosx
52+ export SDK_PATH=$(xcrun --show-sdk-path --sdk $SDK_NAME)
53+ export CC="$(xcrun -sdk $SDK_PATH --find clang) -arch arm64 -isysroot $SDK_PATH"
54+ export CFLAGS="-isysroot $SDK_PATH -arch arm64 -I$SDK_PATH/usr/include"
55+ export LD_LIBRARY_PATH="$SDK_PATH/usr/lib"
56+ export CGO_LDFLAGS="-isysroot $SDK_PATH -arch arm64 -L$lib_tmp"
57+ export CGO_CFLAGS="-isysroot $SDK_PATH -arch arm64 -I/usr/local/include"
58+ CGO_ENABLED=1 GOARCH=arm64 go build -v -ldflags '-w -s' -o redpwnpow-darwin-arm64 ./cmd/redpwnpow
59+ lipo -create -output redpwnpow-darwin redpwnpow-darwin-amd64 redpwnpow-darwin-arm64
4660 - uses : actions/upload-artifact@v2
4761 with :
4862 name : darwin
49- path : redpwnpow-darwin-*
63+ path : redpwnpow-darwin
5064 windows :
5165 runs-on : windows-2019
5266 steps :
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ redpwnpow challenge
2020## kCTF
2121
2222redpwnpow can be used as a drop-in replacement for [ kCTF] ( https://google.github.io/kctf/ ) 's proof of work solver.
23- redpwnpow is approximately ** 10x** faster than kCTF's [ Python solver] ( https://github.com/google/kctf/blob/v1.0/docker-images/challenge/pow.py ) .
23+ redpwnpow is approximately ** 10x faster** than kCTF's [ Python solver] ( https://github.com/google/kctf/blob/v1.0/docker-images/challenge/pow.py ) .
2424
2525## Go module
2626
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ run() {
1313 arm* ) release=linux-armv6l;;
1414 * ) echo unknown linux architecture >&2 ; exit 1
1515 esac ;;
16- darwin* ) release=darwin-amd64 ;;
16+ darwin* ) release=darwin;;
1717 msys* |mingw* |cygwin* ) release=windows-amd64.exe;;
1818 * ) echo unknown operating system >&2 ; exit 1
1919 esac
You can’t perform that action at this time.
0 commit comments