Skip to content

Commit

Permalink
Merge pull request #1 from redpwn/arm
Browse files Browse the repository at this point in the history
  • Loading branch information
ginkoid authored Jul 11, 2021
2 parents 377af8c + a25d048 commit d67e98f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,22 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: 1.16.5
- run: |
sudo apt-get install -y gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf
sudo dpkg --add-architecture arm64
sudo dpkg --add-architecture armhf
echo '
deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe multiverse
deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe multiverse
' | sudo tee /etc/apt/sources.list.d/arm.list
sudo apt-get update || true
sudo apt-get install libgmp-dev:arm64 libgmp-dev:armhf
- uses: actions/checkout@v2
- name: go build
run: go build -v -ldflags '-w -s -extldflags -static' -o redpwnpow-linux-amd64 ./cmd/redpwnpow
run: |
go build -v -ldflags '-w -s -extldflags -static' -o redpwnpow-linux-amd64 ./cmd/redpwnpow
CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOARCH=arm64 go build -v -ldflags '-w -s -extldflags -static' -o redpwnpow-linux-arm64 ./cmd/redpwnpow
CC=arm-linux-gnueabihf-gcc CGO_ENABLED=1 GOARCH=arm go build -v -ldflags '-w -s -extldflags -static' -o redpwnpow-linux-armv6l ./cmd/redpwnpow
- uses: actions/upload-artifact@v2
with:
name: linux
Expand Down
13 changes: 9 additions & 4 deletions cmd/redpwnpow/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@

set -e
version=VERSION
challenge=$1
run() {
case $(uname | tr '[:upper:]' '[:lower:]') in
linux*) release=linux-amd64;;
linux*)
case $(uname -m) in
x86_64) release=linux-amd64;;
aarch64) release=linux-arm64;;
arm*) release=linux-armv6l;;
*) echo unknown linux architecture >&2; exit 1
esac;;
darwin*) release=darwin-amd64;;
msys*|mingw*|cygwin*) release=windows-amd64.exe;;
*) echo unknown operating system >&2; exit 1
Expand All @@ -16,6 +21,6 @@ run() {
mkdir -p "$cache_root"
cache_path=$cache_root/redpwnpow-$version-$release
[ -e "$cache_path" ] || curl -sSfLo "$cache_path" "https://github.com/redpwn/pow/releases/download/$version/redpwnpow-$release" && chmod u+x "$cache_path"
"$cache_path" "$challenge"
"$cache_path" "$@"
}
run
run "$@"

0 comments on commit d67e98f

Please sign in to comment.