File tree Expand file tree Collapse file tree 3 files changed +40
-8
lines changed Expand file tree Collapse file tree 3 files changed +40
-8
lines changed Original file line number Diff line number Diff line change 99 runs-on : ${{ matrix.os }}
1010 strategy :
1111 matrix :
12- os : [ubuntu-latest, macos-latest, windows-latest]
12+ target :
13+ - aarch64-unknown-linux-musl
14+ - x86_64-unknown-linux-gnu
15+ - x86_64-unknown-linux-musl
16+ - x86_64-apple-darwin
17+ - x86_64-pc-windows-msvc
18+ include :
19+ - target : aarch64-unknown-linux-musl
20+ os : ubuntu-latest
21+ - target : x86_64-unknown-linux-gnu
22+ os : ubuntu-latest
23+ - target : x86_64-unknown-linux-musl
24+ os : ubuntu-latest
25+ - target : x86_64-apple-darwin
26+ os : macos-latest
27+ - target : x86_64-pc-windows-msvc
28+ os : windows-latest
1329 steps :
1430 - uses : actions/checkout@master
1531 - name : Install hub
1632 run : ci/install-hub.sh ${{ matrix.os }}
1733 shell : bash
1834 - name : Install Rust
19- run : ci/install-rust.sh stable
35+ run : ci/install-rust.sh stable ${{ matrix.target }}
2036 shell : bash
2137 - name : Build and deploy artifacts
2238 env :
2339 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
24- run : ci/make-release.sh ${{ matrix.os }}
40+ run : ci/make-release.sh ${{ matrix.os }} ${{ matrix.target }}
2541 shell : bash
2642 pages :
2743 name : GitHub Pages
Original file line number Diff line number Diff line change @@ -13,6 +13,17 @@ TOOLCHAIN="$1"
1313rustup set profile minimal
1414rustup component remove --toolchain=$TOOLCHAIN rust-docs || echo " already removed"
1515rustup update --no-self-update $TOOLCHAIN
16+ if [ -n " $2 " ]
17+ then
18+ TARGET=" $2 "
19+ HOST=$( rustc -Vv | grep ^host: | sed -e " s/host: //g" )
20+ if [ " $HOST " != " $TARGET " ]
21+ then
22+ rustup component add llvm-tools-preview --toolchain=$TOOLCHAIN
23+ rustup component add rust-std-$TARGET --toolchain=$TOOLCHAIN
24+ fi
25+ fi
26+
1627rustup default $TOOLCHAIN
1728rustup -V
1829rustc -Vv
Original file line number Diff line number Diff line change 1111TAG=${GITHUB_REF#*/ tags/ }
1212
1313host=$( rustc -Vv | grep ^host: | sed -e " s/host: //g" )
14+ target=$2
15+ if [ " $host " != " $target " ]
16+ then
17+ export " CARGO_TARGET_$( echo $target | tr a-z- A-Z_) _LINKER" =rust-lld
18+ fi
1419export CARGO_PROFILE_RELEASE_LTO=true
15- cargo build --bin mdbook --release
16- cd target/release
20+ cargo build --bin mdbook --release --target $target
21+ cd target/$target / release
1722case $1 in
1823 ubuntu* )
19- asset=" mdbook-$TAG -$host .tar.gz"
24+ asset=" mdbook-$TAG -$target .tar.gz"
2025 tar czf ../../$asset mdbook
2126 ;;
2227 macos* )
23- asset=" mdbook-$TAG -$host .tar.gz"
28+ asset=" mdbook-$TAG -$target .tar.gz"
2429 # There is a bug with BSD tar on macOS where the first 8MB of the file are
2530 # sometimes all NUL bytes. See https://github.com/actions/cache/issues/403
2631 # and https://github.com/rust-lang/cargo/issues/8603 for some more
@@ -30,7 +35,7 @@ case $1 in
3035 tar czf ../../$asset mdbook
3136 ;;
3237 windows* )
33- asset=" mdbook-$TAG -$host .zip"
38+ asset=" mdbook-$TAG -$target .zip"
3439 7z a ../../$asset mdbook.exe
3540 ;;
3641 * )
You can’t perform that action at this time.
0 commit comments