@@ -895,19 +895,15 @@ jobs:
895895
896896 # This is ci/actions-templates/macos-builds-template.yaml
897897 # Do not edit this file in .github/workflows
898- build-macos : # job-name
899- runs-on : macos-latest
898+ build-macos-x86_64 : # job-name skip-aarch64
899+ runs-on : macos-13 # skip-aarch64
900900 strategy :
901901 matrix :
902902 target :
903- - x86_64-apple-darwin
904- - aarch64-apple-darwin
903+ - x86_64-apple-darwin # skip-aarch64
905904 mode :
906905 - dev
907906 - release
908- include :
909- - target : x86_64-apple-darwin
910- run_tests : YES
911907 steps :
912908 - uses : actions/checkout@v4
913909 with :
@@ -930,7 +926,7 @@ jobs:
930926 echo "SKIP_TESTS=" >> $GITHUB_ENV
931927 echo "LZMA_API_STATIC=1" >> $GITHUB_ENV
932928 - name : Skip tests
933- if : matrix.run_tests == '' || matrix. mode == 'release'
929+ if : matrix.mode == 'release'
934930 run : |
935931 echo "SKIP_TESTS=yes" >> $GITHUB_ENV
936932 - name : Cache cargo registry and git trees
@@ -960,12 +956,119 @@ jobs:
960956 rustup toolchain uninstall stable
961957 fi
962958 rustup toolchain install --profile=minimal stable
963- - name : aarch64-specific items
959+ - name : Ensure we have our goal target installed
960+ run : |
961+ rustup target install "$TARGET"
962+ - name : Run a full build and test
963+ env :
964+ BUILD_PROFILE : ${{ matrix.mode }}
965+ run : bash ci/run.bash
966+ - name : Dump dynamic link targets
967+ if : matrix.mode == 'release'
968+ run : |
969+ otool -L target/${TARGET}/release/rustup-init
970+ if otool -L target/${TARGET}/release/rustup-init | grep -q -F /usr/local/; then
971+ echo >&2 "Unfortunately there are /usr/local things in the link. Fail."
972+ exit 1
973+ fi
974+ - name : Upload the built artifact
975+ if : matrix.mode == 'release'
976+ uses : actions/upload-artifact@v4
977+ with :
978+ name : rustup-init-${{ matrix.target }}
979+ path : |
980+ target/${{ matrix.target }}/release/rustup-init
981+ retention-days : 7
982+ - name : Acquire the AWS tooling
983+ if : github.event_name == 'push' && github.ref == 'refs/heads/stable' && matrix.mode == 'release'
964984 run : |
965- # Use nightly for now
966- rustup toolchain install --profile=minimal nightly
967- rustup default nightly
968- if : matrix.target == 'aarch64-apple-darwin'
985+ pip3 install awscli
986+ - name : Prepare the dist
987+ if : github.event_name == 'push' && github.ref == 'refs/heads/stable' && matrix.mode == 'release'
988+ run : |
989+ bash ci/prepare-deploy.bash
990+ - name : Deploy build to dev-static dist tree for release team
991+ if : github.event_name == 'push' && github.ref == 'refs/heads/stable' && matrix.mode == 'release'
992+ run : |
993+ aws s3 cp --recursive deploy/ s3://dev-static-rust-lang-org/rustup/
994+ env :
995+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
996+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
997+ AWS_DEFAULT_REGION : us-west-1
998+ - name : Clear the cargo caches
999+ run : |
1000+ cargo install cargo-cache --no-default-features --features ci-autoclean
1001+ cargo-cache
1002+ - name : Flush cache
1003+ # This is a workaround for a bug with GitHub Actions Cache that causes
1004+ # corrupt cache entries (particularly in the target directory). See
1005+ # https://github.com/actions/cache/issues/403 and
1006+ # https://github.com/rust-lang/cargo/issues/8603.
1007+ run : sudo /usr/sbin/purge
1008+
1009+ # This is ci/actions-templates/macos-builds-template.yaml
1010+ # Do not edit this file in .github/workflows
1011+ build-macos-aarch64 : # job-name skip-x86_64
1012+ runs-on : macos-14 # skip-x86_64
1013+ strategy :
1014+ matrix :
1015+ target :
1016+ - aarch64-apple-darwin # skip-x86_64
1017+ mode :
1018+ - dev
1019+ - release
1020+ steps :
1021+ - uses : actions/checkout@v4
1022+ with :
1023+ # v2 defaults to a shallow checkout, but we need at least to the previous tag
1024+ fetch-depth : 0
1025+ - name : Acquire tags for the repo
1026+ run : |
1027+ git fetch --no-tags --prune --depth=1 origin +refs/tags/*:refs/tags/*
1028+ - name : Display the current git status
1029+ run : |
1030+ git status
1031+ git describe
1032+ - name : Prep cargo dirs
1033+ run : |
1034+ mkdir -p ~/.cargo/{registry,git}
1035+ - name : Set environment variables appropriately for the build
1036+ run : |
1037+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
1038+ echo "TARGET=${{ matrix.target }}" >> $GITHUB_ENV
1039+ echo "SKIP_TESTS=" >> $GITHUB_ENV
1040+ echo "LZMA_API_STATIC=1" >> $GITHUB_ENV
1041+ - name : Skip tests
1042+ if : matrix.mode == 'release'
1043+ run : |
1044+ echo "SKIP_TESTS=yes" >> $GITHUB_ENV
1045+ - name : Cache cargo registry and git trees
1046+ uses : actions/cache@v4
1047+ with :
1048+ path : |
1049+ ~/.cargo/registry
1050+ ~/.cargo/git
1051+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
1052+ - name : Get rustc commit hash
1053+ id : cargo-target-cache
1054+ run : |
1055+ echo "{rust_hash}={$(rustc -Vv | grep commit-hash | awk '{print $2}')}" >> $GITHUB_OUTPUT
1056+ shell : bash
1057+ - name : Cache cargo build
1058+ uses : actions/cache@v4
1059+ with :
1060+ path : target
1061+ key : ${{ github.base_ref }}-${{ github.head_ref }}-${{ matrix.target }}-${{ matrix.mode }}-cargo-target-dir-${{ steps.cargo-target-cache.outputs.rust_hash }}-${{ hashFiles('**/Cargo.lock') }}
1062+ restore-keys : ${{ github.base_ref }}-${{ matrix.target }}-${{ matrix.mode }}-cargo-target-dir-${{ steps.cargo-target-cache.outputs.rust_hash }}-${{ hashFiles('**/Cargo.lock') }}
1063+ - name : Install Rustup using ./rustup-init.sh
1064+ run : |
1065+ sh ./rustup-init.sh --default-toolchain=none --profile=minimal -y
1066+ - name : Ensure Stable is up to date
1067+ run : |
1068+ if rustc +stable -vV >/dev/null 2>/dev/null; then
1069+ rustup toolchain uninstall stable
1070+ fi
1071+ rustup toolchain install --profile=minimal stable
9691072 - name : Ensure we have our goal target installed
9701073 run : |
9711074 rustup target install "$TARGET"
@@ -1218,7 +1321,8 @@ jobs:
12181321 - build-linux-pr
12191322 - build-linux-master
12201323 - build-linux-stable
1221- - build-macos
1324+ - build-macos-aarch64
1325+ - build-macos-x86_64
12221326 - doc
12231327 - build-windows-pr
12241328 - build-windows-master
0 commit comments