Skip to content

Commit

Permalink
Do not build sui in debug mode for macos-arm64 and delete unused soft…
Browse files Browse the repository at this point in the history
…ware. (#19210)

## Description 
Do not build sui in debug mode for `macos-arm64` and delete unused
software.
```
Filesystem        Size    Used   Avail Capacity  Mounted on
/dev/disk3s1s1   295Gi   9.6Gi    17Gi    37%    /
Filesystem        Size    Used   Avail Capacity  Mounted on
/dev/disk3s1s1   295Gi   9.6Gi    89Gi    10%    /
```

## Test plan 

https://github.com/MystenLabs/sui/actions/runs/10725603432/job/29743813335
  • Loading branch information
ebmifa authored Sep 5, 2024
1 parent 9a3a085 commit a831de6
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Attach Sui binaries to a release
run-name: Attach Sui binaries to a ${{ inputs.sui_tag }} release

on:
release:
Expand Down Expand Up @@ -123,7 +124,7 @@ jobs:
echo "PG_DATABASE_URL=postgres://postgres:root@localhost/" >> $GITHUB_ENV
echo "PG_EXAMPLE_DATABASE_URL=postgres://postgres:root@localhost/diesel_example" >> $GITHUB_ENV
- name: Install postgres (Mac arm64)
- name: Install postgres (MacOS arm64)
if: ${{ matrix.os == 'macos-latest-xlarge' && env.gcloud_archive_exist == '' }}
shell: bash
env:
Expand All @@ -134,12 +135,37 @@ jobs:
run: |
brew install postgresql
- name: Removed unused apps (MacOS arm64)
if: ${{ matrix.os == 'macos-latest-xlarge' && env.gcloud_archive_exist == '' }}
continue-on-error: true
shell: bash
run: |
# MacOS arm64 runner only has 14GB avaialble, which is too small for our builds, so removing unused softwared.
df -hI /dev/disk3s1s1
sudo rm -rf /Applications/Xcode_14.3.1.app
sudo rm -rf /Applications/Xcode_15.0.1.app
sudo rm -rf /Applications/Xcode_15.1.app
sudo rm -rf /Applications/Xcode_15.2.app
sudo rm -rf /Applications/Xcode_15.3.app
sudo rm -rf ~/Library/Developer/Xcode/DerivedData
sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/*
sudo rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport/*
df -hI /dev/disk3s1s1
- name: Cargo build for ${{ matrix.os }} platform
if: ${{ env.s3_archive_exist == '' }}
shell: bash
run: |
[ -f ~/.cargo/env ] && source ~/.cargo/env ; cargo build --bin sui --release --features indexer && mv target/release/sui target/release/sui-pg
[ -f ~/.cargo/env ] && source ~/.cargo/env ; cargo build --release && cargo build --profile=dev --bin sui
[ -f ~/.cargo/env ] && source ~/.cargo/env ; cargo build --release
- name: Cargo build sui in debug mode (Ubuntu)
if: ${{ matrix.os == 'ubuntu-ghcloud' && env.s3_archive_exist == '' }}
shell: bash
run: |
[ -f ~/.cargo/env ] && source ~/.cargo/env ; cargo build --profile=dev --bin sui
mkdir -p ${{ env.TMP_BUILD_DIR }}
mv ./target/debug/sui${{ env.extention }} ${{ env.TMP_BUILD_DIR }}/sui-debug${{ env.extention }}
- name: Rename binaries for ${{ matrix.os }}
if: ${{ env.s3_archive_exist == '' }}
Expand All @@ -157,7 +183,6 @@ jobs:
export binary=$(echo "sui-pg" | tr -d $'\r')
mv ./target/release/${binary}${{ env.extention }} ${{ env.TMP_BUILD_DIR }}/${binary}${{ env.extention }}
mv ./target/debug/sui${{ env.extention }} ${{ env.TMP_BUILD_DIR }}/sui-debug${{ env.extention }}
tar -cvzf ./tmp/sui-${{ env.sui_tag }}-${{ env.os_type }}.tgz -C ${{ env.TMP_BUILD_DIR }} .
[[ ${{ env.sui_tag }} == *"testnet"* ]] && aws s3 cp ./tmp/sui-${{ env.sui_tag }}-${{ env.os_type }}.tgz s3://sui-releases/releases/sui-${{ env.sui_tag }}-${{ env.os_type }}.tgz || true
Expand Down

0 comments on commit a831de6

Please sign in to comment.