Skip to content

Commit

Permalink
Release platform-tools v1.36
Browse files Browse the repository at this point in the history
  • Loading branch information
dmakarov committed Mar 10, 2023
1 parent 86a4f5d commit edf9cc6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 85 deletions.
89 changes: 21 additions & 68 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,47 +68,30 @@ jobs:
- name: Build
run: ./build.sh ${{ matrix.out_dir }}
shell: bash
- name: Upload ${{ matrix.tar }} BPF tarball
- name: Upload ${{ matrix.tar }} tarball
uses: actions/upload-artifact@v3
with:
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 }}-x86_64.tar.bz2
path: solana-sbf-tools-${{ matrix.tar }}-x86_64.tar.bz2
name: platform-tools-${{ matrix.tar }}-x86_64.tar.bz2
path: platform-tools-${{ matrix.tar }}-x86_64.tar.bz2

release:
name: Upload Release Assets
needs: build
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
- name: Download Linux BPF tarball
uses: actions/download-artifact@v3
with:
name: solana-bpf-tools-linux-x86_64.tar.bz2
- name: Download macOS BPF tarball
- name: Download Linux tarball
uses: actions/download-artifact@v3
with:
name: solana-bpf-tools-osx-x86_64.tar.bz2
- name: Download Linux SBF tarball
name: platform-tools-linux-x86_64.tar.bz2
- name: Download macOS tarball
uses: actions/download-artifact@v3
with:
name: solana-sbf-tools-linux-x86_64.tar.bz2
- name: Download macOS SBF tarball
name: platform-tools-osx-x86_64.tar.bz2
- name: Download Windows tarball
uses: actions/download-artifact@v3
with:
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-x86_64.tar.bz2
- name: Download Windows SBF tarball
uses: actions/download-artifact@v3
with:
name: solana-sbf-tools-windows-x86_64.tar.bz2
name: platform-tools-windows-x86_64.tar.bz2
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -119,63 +102,33 @@ jobs:
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Release Linux BPF tarball
id: upload-release-linux-bpf
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
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
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
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
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
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
- name: Release Linux tarball
id: upload-release-linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: solana-sbf-tools-osx-x86_64.tar.bz2
asset_name: solana-sbf-tools-osx-x86_64.tar.bz2
asset_path: platform-tools-linux-x86_64.tar.bz2
asset_name: platform-tools-linux-x86_64.tar.bz2
asset_content_type: application/zip
- name: Release Windows BPF tarball
id: upload-release-windows-bpf
- name: Release macOS tarball
id: upload-release-macos
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: solana-bpf-tools-windows-x86_64.tar.bz2
asset_name: solana-bpf-tools-windows-x86_64.tar.bz2
asset_path: platform-tools-osx-x86_64.tar.bz2
asset_name: platform-tools-osx-x86_64.tar.bz2
asset_content_type: application/zip
- name: Release Windows SBF tarball
id: upload-release-windows-sbf
- name: Release Windows tarball
id: upload-release-windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: solana-sbf-tools-windows-x86_64.tar.bz2
asset_name: solana-sbf-tools-windows-x86_64.tar.bz2
asset_path: platform-tools-windows-x86_64.tar.bz2
asset_name: platform-tools-windows-x86_64.tar.bz2
asset_content_type: application/zip
30 changes: 13 additions & 17 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ case "${unameOut}" in
EXE_SUFFIX=
if [[ "$(uname -m)" == "arm64" ]] ; then
HOST_TRIPLE=aarch64-apple-darwin
ARTIFACT=solana-bpf-tools-osx-aarch64.tar.bz2
ARTIFACT=platform-tools-osx-aarch64.tar.bz2
else
HOST_TRIPLE=x86_64-apple-darwin
ARTIFACT=solana-bpf-tools-osx-x86_64.tar.bz2
ARTIFACT=platform-tools-osx-x86_64.tar.bz2
fi;;
MINGW*)
EXE_SUFFIX=.exe
HOST_TRIPLE=x86_64-pc-windows-msvc
ARTIFACT=solana-bpf-tools-windows-x86_64.tar.bz2;;
ARTIFACT=platform-tools-windows-x86_64.tar.bz2;;
Linux* | *)
EXE_SUFFIX=
if [[ "$(uname -m)" == "arm64" ]] ; then
HOST_TRIPLE=aarch64-unknown-linux-gnu
ARTIFACT=solana-bpf-tools-linux-aarch64.tar.bz2
ARTIFACT=platform-tools-linux-aarch64.tar.bz2
else
HOST_TRIPLE=x86_64-unknown-linux-gnu
ARTIFACT=solana-bpf-tools-linux-x86_64.tar.bz2
ARTIFACT=platform-tools-linux-x86_64.tar.bz2
fi
esac

Expand All @@ -34,10 +34,10 @@ rm -rf "${OUT_DIR}"
mkdir -p "${OUT_DIR}"
pushd "${OUT_DIR}"

git clone --single-branch --branch sbf-tools-v1.35 https://github.com/solana-labs/rust.git
git clone --single-branch --branch solana-tools-v1.36 https://github.com/solana-labs/rust.git
echo "$( cd rust && git rev-parse HEAD ) https://github.com/solana-labs/rust.git" >> version.md

git clone --single-branch --branch sbf-tools-v1.35 https://github.com/solana-labs/cargo.git
git clone --single-branch --branch solana-tools-v1.36 https://github.com/solana-labs/cargo.git
echo "$( cd cargo && git rev-parse HEAD ) https://github.com/solana-labs/cargo.git" >> version.md

pushd rust
Expand All @@ -57,7 +57,7 @@ fi
popd

if [[ "${HOST_TRIPLE}" != "x86_64-pc-windows-msvc" ]] ; then
git clone --single-branch --branch sbf-tools-v1.35 https://github.com/solana-labs/newlib.git
git clone --single-branch --branch solana-tools-v1.36 https://github.com/solana-labs/newlib.git
echo "$( cd newlib && git rev-parse HEAD ) https://github.com/solana-labs/newlib.git" >> version.md
mkdir -p newlib_build
mkdir -p newlib_install
Expand All @@ -77,7 +77,7 @@ cp -R "rust/build/${HOST_TRIPLE}/stage1/bin" deploy/rust/
cp -R "cargo/target/release/cargo${EXE_SUFFIX}" deploy/rust/bin/
mkdir -p deploy/rust/lib/rustlib/
cp -R "rust/build/${HOST_TRIPLE}/stage1/lib/rustlib/${HOST_TRIPLE}" deploy/rust/lib/rustlib/
cp -R "rust/build/${HOST_TRIPLE}/stage1/lib/rustlib/bpfel-unknown-unknown" deploy/rust/lib/rustlib/
cp -R "rust/build/${HOST_TRIPLE}/stage1/lib/rustlib/sbf-solana-solana" deploy/rust/lib/rustlib/
find . -maxdepth 6 -type f -path "./rust/build/${HOST_TRIPLE}/stage1/lib/*" -exec cp {} deploy/rust/lib \;
mkdir -p deploy/rust/lib/rustlib/src/rust
cp "rust/build/${HOST_TRIPLE}/stage1/lib/rustlib/src/rust/Cargo.lock" deploy/rust/lib/rustlib/src/rust
Expand Down Expand Up @@ -155,20 +155,16 @@ EOF

tar -C deploy -jcf ${ARTIFACT} .

rm -rf deploy/rust/lib/rustlib/bpfel-unknown-unknown
cp -R "rust/build/${HOST_TRIPLE}/stage1/lib/rustlib/sbf-solana-solana" deploy/rust/lib/rustlib/
tar -C deploy -jcf ${ARTIFACT/bpf/sbf} .

popd

mv "${OUT_DIR}/${ARTIFACT}" "${OUT_DIR}/${ARTIFACT/bpf/sbf}" .
mv "${OUT_DIR}/${ARTIFACT}" .

# Build linux binaries on macOS in docker
if [[ "$(uname)" == "Darwin" ]] && [[ $# == 1 ]] && [[ "$1" == "--docker" ]] ; then
docker system prune -a -f
docker build -t solanalabs/bpf-tools .
id=$(docker create solanalabs/bpf-tools /build.sh "${OUT_DIR}")
docker build -t solanalabs/platform-tools .
id=$(docker create solanalabs/platform-tools /build.sh "${OUT_DIR}")
docker cp build.sh "${id}:/"
docker start -a "${id}"
docker cp "${id}:${OUT_DIR}/solana-bpf-tools-linux-x86_64.tar.bz2" "${OUT_DIR}"
docker cp "${id}:${OUT_DIR}/solana-sbf-tools-linux-x86_64.tar.bz2" "${OUT_DIR}"
fi

0 comments on commit edf9cc6

Please sign in to comment.