Skip to content

Commit

Permalink
Build ARM64 client on dedicated runner
Browse files Browse the repository at this point in the history
  • Loading branch information
drogus committed Oct 5, 2023
1 parent 93c593b commit 055f01a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 59 deletions.
47 changes: 34 additions & 13 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,54 @@ on:
- '**'
branches:
- master
- drogus/arm-build-on-arm-worker

jobs:
linux-client:
linux-amd64-client:
runs-on: bare-metal

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Compile Aarch64 Docker
- name: Compile x86
run: |
docker buildx build --platform=linux/arm64 -f crates/cli/Dockerfile -t cli .
export PATH=$HOME/.cargo/bin:$PATH
cargo build --release -p spacetimedb-cli
mkdir build
id=$(docker create cli)
docker cp $id:/usr/local/bin/spacetime - > build/spacetime.linux-arm64.tar
docker rm -v $id
cd build
gzip spacetime.linux-arm64.tar
mv target/release/spacetime build/spacetime
cd build && tar -czf spacetime.linux-amd64.tar.gz spacetime
rm spacetime
- name: Compile x86
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Upload to DO Spaces
uses: shallwefootball/s3-upload-action@master
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: ${{ vars.AWS_BUCKET }}
source_dir: build
endpoint: https://nyc3.digitaloceanspaces.com
destination_dir: ${{ steps.extract_branch.outputs.branch }}

linux-arm64-client:
runs-on: arm-runner

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Compile ARM64
run: |
export PATH=$HOME/.cargo/bin:$PATH
cargo build --release -p spacetimedb-cli
mkdir build
mv target/release/spacetime build/spacetime
cd build && tar -czf spacetime.linux-amd64.tar.gz spacetime
cd build && tar -czf spacetime.linux-arm64.tar.gz spacetime
rm spacetime
- name: Extract branch name
Expand Down
46 changes: 0 additions & 46 deletions crates/cli/Dockerfile

This file was deleted.

0 comments on commit 055f01a

Please sign in to comment.