@@ -895,21 +895,15 @@ jobs:
895
895
896
896
# This is ci/actions-templates/macos-builds-template.yaml
897
897
# Do not edit this file in .github/workflows
898
- build-macos : # job-name
899
- runs-on : macos-14
898
+ build-macos-x86_64 : # job-name skip-aarch64
899
+ runs-on : macos-13 # skip-aarch64
900
900
strategy :
901
901
matrix :
902
902
target :
903
- - x86_64-apple-darwin
904
- - aarch64-apple-darwin
903
+ - x86_64-apple-darwin # skip-aarch64
905
904
mode :
906
905
- dev
907
906
- release
908
- include :
909
- - target : x86_64-apple-darwin
910
- run_tests : YES
911
- - target : aarch64-apple-darwin
912
- run_tests : YES
913
907
steps :
914
908
- uses : actions/checkout@v4
915
909
with :
@@ -932,7 +926,120 @@ jobs:
932
926
echo "SKIP_TESTS=" >> $GITHUB_ENV
933
927
echo "LZMA_API_STATIC=1" >> $GITHUB_ENV
934
928
- name : Skip tests
935
- if : matrix.run_tests == '' || matrix.mode == 'release'
929
+ if : matrix.mode == 'release'
930
+ run : |
931
+ echo "SKIP_TESTS=yes" >> $GITHUB_ENV
932
+ - name : Cache cargo registry and git trees
933
+ uses : actions/cache@v4
934
+ with :
935
+ path : |
936
+ ~/.cargo/registry
937
+ ~/.cargo/git
938
+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
939
+ - name : Get rustc commit hash
940
+ id : cargo-target-cache
941
+ run : |
942
+ echo "{rust_hash}={$(rustc -Vv | grep commit-hash | awk '{print $2}')}" >> $GITHUB_OUTPUT
943
+ shell : bash
944
+ - name : Cache cargo build
945
+ uses : actions/cache@v4
946
+ with :
947
+ path : target
948
+ key : ${{ github.base_ref }}-${{ github.head_ref }}-${{ matrix.target }}-${{ matrix.mode }}-cargo-target-dir-${{ steps.cargo-target-cache.outputs.rust_hash }}-${{ hashFiles('**/Cargo.lock') }}
949
+ restore-keys : ${{ github.base_ref }}-${{ matrix.target }}-${{ matrix.mode }}-cargo-target-dir-${{ steps.cargo-target-cache.outputs.rust_hash }}-${{ hashFiles('**/Cargo.lock') }}
950
+ - name : Install Rustup using ./rustup-init.sh
951
+ run : |
952
+ sh ./rustup-init.sh --default-toolchain=none --profile=minimal -y
953
+ - name : Ensure Stable is up to date
954
+ run : |
955
+ if rustc +stable -vV >/dev/null 2>/dev/null; then
956
+ rustup toolchain uninstall stable
957
+ fi
958
+ rustup toolchain install --profile=minimal stable
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'
984
+ run : |
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'
936
1043
run : |
937
1044
echo "SKIP_TESTS=yes" >> $GITHUB_ENV
938
1045
- name : Cache cargo registry and git trees
@@ -1214,7 +1321,8 @@ jobs:
1214
1321
- build-linux-pr
1215
1322
- build-linux-master
1216
1323
- build-linux-stable
1217
- - build-macos
1324
+ - build-macos-aarch64
1325
+ - build-macos-x86_64
1218
1326
- doc
1219
1327
- build-windows-pr
1220
1328
- build-windows-master
0 commit comments