Skip to content

Commit

Permalink
Support amd64 and arm64 build script
Browse files Browse the repository at this point in the history
  • Loading branch information
hahwul committed Aug 23, 2023
1 parent 989bc2f commit 2a8a1da
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ on:
branches: [ main ]

jobs:

build:
strategy:
matrix:
os: [ubuntu-latest]
arch: [amd64, arm64]

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
Expand Down
14 changes: 13 additions & 1 deletion geckodriver.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
#/bin/bash -l

url=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest | jq -r '.assets[].browser_download_url | select(contains("linux64") and endswith("gz"))')
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then
ARCH="amd64"
url=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest | jq -r '.assets[].browser_download_url | select(contains("linux64") and endswith("gz"))')
elif [ "$ARCH" = "aarch64" ]; then
ARCH="arm64"
url=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest | jq -r '.assets[].browser_download_url | select(contains("linux-aarch64") and endswith("gz"))')
else
echo "Unsupported architecture"
echo "Use to x86_64 mode"
url=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest | jq -r '.assets[].browser_download_url | select(contains("linux64") and endswith("gz"))')
fi

curl -s -L "$url" -o /build/geckodriver.gz
tar -xvf /build/geckodriver.gz

0 comments on commit 2a8a1da

Please sign in to comment.