Skip to content

Commit

Permalink
Add aarch64 to build hosts running macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
dmakarov committed Feb 10, 2023
1 parent 64b7777 commit 7a20f4f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 27 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ jobs:
- name: Upload ${{ matrix.tar }} BPF tarball
uses: actions/upload-artifact@v3
with:
name: solana-bpf-tools-${{ matrix.tar }}.tar.bz2
path: solana-bpf-tools-${{ matrix.tar }}.tar.bz2
name: solana-bpf-tools-${{ matrix.tar }}-x86_64.tar.bz2
path: solana-bpf-tools-${{ matrix.tar }}-x86_64.tar.bz2
- name: Upload ${{ matrix.tar }} SBF tarball
uses: actions/upload-artifact@v3
with:
name: solana-sbf-tools-${{ matrix.tar }}.tar.bz2
path: solana-sbf-tools-${{ matrix.tar }}.tar.bz2
name: solana-sbf-tools-${{ matrix.tar }}-x86_64.tar.bz2
path: solana-sbf-tools-${{ matrix.tar }}-x86_64.tar.bz2

release:
name: Upload Release Assets
Expand All @@ -88,27 +88,27 @@ jobs:
- name: Download Linux BPF tarball
uses: actions/download-artifact@v3
with:
name: solana-bpf-tools-linux.tar.bz2
name: solana-bpf-tools-linux-x86_64.tar.bz2
- name: Download macOS BPF tarball
uses: actions/download-artifact@v3
with:
name: solana-bpf-tools-osx.tar.bz2
name: solana-bpf-tools-osx-x86_64.tar.bz2
- name: Download Linux SBF tarball
uses: actions/download-artifact@v3
with:
name: solana-sbf-tools-linux.tar.bz2
name: solana-sbf-tools-linux-x86_64.tar.bz2
- name: Download macOS SBF tarball
uses: actions/download-artifact@v3
with:
name: solana-sbf-tools-osx.tar.bz2
name: solana-sbf-tools-osx-x86_64.tar.bz2
- name: Download Windows BPF tarball
uses: actions/download-artifact@v3
with:
name: solana-bpf-tools-windows.tar.bz2
- name: Download Windows SBF tarball
uses: actions/download-artifact@v3
with:
name: solana-sbf-tools-windows.tar.bz2
name: solana-sbf-tools-windows-x86_64.tar.bz2
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -126,8 +126,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: solana-bpf-tools-linux.tar.bz2
asset_name: solana-bpf-tools-linux.tar.bz2
asset_path: solana-bpf-tools-linux-x86_64.tar.bz2
asset_name: solana-bpf-tools-linux-x86_64.tar.bz2
asset_content_type: application/zip
- name: Release macOS BPF tarball
id: upload-release-macos-bpf
Expand All @@ -136,8 +136,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: solana-bpf-tools-osx.tar.bz2
asset_name: solana-bpf-tools-osx.tar.bz2
asset_path: solana-bpf-tools-osx-x86_64.tar.bz2
asset_name: solana-bpf-tools-osx-x86_64.tar.bz2
asset_content_type: application/zip
- name: Release Linux SBF tarball
id: upload-release-linux-sbf
Expand All @@ -146,8 +146,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: solana-sbf-tools-linux.tar.bz2
asset_name: solana-sbf-tools-linux.tar.bz2
asset_path: solana-sbf-tools-linux-x86_64.tar.bz2
asset_name: solana-sbf-tools-linux-x86_64.tar.bz2
asset_content_type: application/zip
- name: Release macOS SBF tarball
id: upload-release-macos-sbf
Expand All @@ -156,8 +156,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: solana-sbf-tools-osx.tar.bz2
asset_name: solana-sbf-tools-osx.tar.bz2
asset_path: solana-sbf-tools-osx-x86_64.tar.bz2
asset_name: solana-sbf-tools-osx-x86_64.tar.bz2
asset_content_type: application/zip
- name: Release Windows BPF tarball
id: upload-release-windows-bpf
Expand All @@ -166,8 +166,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: solana-bpf-tools-windows.tar.bz2
asset_name: solana-bpf-tools-windows.tar.bz2
asset_path: solana-bpf-tools-windows-x86_64.tar.bz2
asset_name: solana-bpf-tools-windows-x86_64.tar.bz2
asset_content_type: application/zip
- name: Release Windows SBF tarball
id: upload-release-windows-sbf
Expand All @@ -176,6 +176,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: solana-sbf-tools-windows.tar.bz2
asset_name: solana-sbf-tools-windows.tar.bz2
asset_path: solana-sbf-tools-windows-x86_64.tar.bz2
asset_name: solana-sbf-tools-windows-x86_64.tar.bz2
asset_content_type: application/zip
22 changes: 16 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,26 @@ unameOut="$(uname -s)"
case "${unameOut}" in
Darwin*)
EXE_SUFFIX=
HOST_TRIPLE=x86_64-apple-darwin
ARTIFACT=solana-bpf-tools-osx.tar.bz2;;
if [[ "$(uname -m)" == "arm64" ]] ; then
HOST_TRIPLE=aarch64-apple-darwin
ARTIFACT=solana-bpf-tools-osx-aarch64.tar.bz2
else
HOST_TRIPLE=x86_64-apple-darwin
ARTIFACT=solana-bpf-tools-osx-x86_64.tar.bz2
fi;;
MINGW*)
EXE_SUFFIX=.exe
HOST_TRIPLE=x86_64-pc-windows-msvc
ARTIFACT=solana-bpf-tools-windows.tar.bz2;;
ARTIFACT=solana-bpf-tools-windows-x86_64.tar.bz2;;
Linux* | *)
EXE_SUFFIX=
HOST_TRIPLE=x86_64-unknown-linux-gnu
ARTIFACT=solana-bpf-tools-linux.tar.bz2
if [[ "$(uname -m)" == "arm64" ]] ; then
HOST_TRIPLE=aarch64-unknown-linux-gnu
ARTIFACT=solana-bpf-tools-linux-aarch64.tar.bz2
else
HOST_TRIPLE=x86_64-unknown-linux-gnu
ARTIFACT=solana-bpf-tools-linux-x86_64.tar.bz2
fi
esac

cd "$(dirname "$0")"
Expand Down Expand Up @@ -160,5 +170,5 @@ if [[ "$(uname)" == "Darwin" ]] && [[ $# == 1 ]] && [[ "$1" == "--docker" ]] ; t
id=$(docker create solanalabs/bpf-tools /build.sh "${OUT_DIR}")
docker cp build.sh "${id}:/"
docker start -a "${id}"
docker cp "${id}:${OUT_DIR}/solana-bpf-tools-linux.tar.bz2" "${OUT_DIR}"
docker cp "${id}:${OUT_DIR}/solana-bpf-tools-linux-x86_64.tar.bz2" "${OUT_DIR}"
fi

0 comments on commit 7a20f4f

Please sign in to comment.